Skip to content

V4 Livestock Enteric Fermentation and Manure Management - #90

Open
burnettear wants to merge 3 commits into
v4from
v4_update_emis
Open

V4 Livestock Enteric Fermentation and Manure Management#90
burnettear wants to merge 3 commits into
v4from
v4_update_emis

Conversation

@burnettear

Copy link
Copy Markdown
Contributor

Updated both Livestock Enteric Fermentation and Manure Management.

Since 2023 emi data is at state-level, we disaggregated the state-level data to county-level based on 2022 proportions. Not all V4 (2023) state-level data used the same categories as V3 (2012-2022) data, so a process was used to break emis down to base form before aggregating/disaggregating. The process is defined below:

  1. Calculate 2012-2022 county-level emissions using V3 data
  2. Calculate 2022 county-level proportions using V3 data with V4 categories
  3. Read in 2023 state-level emissions using V4 data
  4. Apply 2022 county-level proportions to 2023 state-level emissions to get 2023 county-level emissions
  5. Append 2012-2022 county-level emissions with 2023 county-level emissions

Effectively, this broke down emis, filtered for the relevant emis to create proportions, applied proportions to new data, and appended emis to report 2012-2023.

@burnettear

Copy link
Copy Markdown
Contributor Author

Update config, utils, and emi/proxy files

Config & Utils

config.py: Updated V3_Paths to V4_Paths, updated max_year to 2023, and changed load_road_globals to v4_paths.
utils.py: added import box; updated road_globals v4_paths and functions

Emis Scripts

task_abandoned_coal_emis.py: Updated V4_Path, changed skip rows parameter.
task_abandoned_og_wells_emi.py: Updated V4_Path and file names, removed unnecessary pd.read_excel parameters, made Pytask.
task_anaerobic_digestion_emi.py: Updated file paths and function parameters.
task_carbides_emis.py: Updated file paths and function parameters.
task_coal_surf_emi.py: Updated file paths and function parameters.
task_coal_under_emi.py: Updated file paths and function parameters.
task_composting_emi.py: Updated file paths and function parameters. GHGI file uses georef (instead of state in V3), updated script.
task_dom_wastewater_emi..py: Updated file paths and function parameters.
task_ferro_emi.py: Updated file paths and function parameters. Added code to remove empty states.
task_field_burning_emi.py: Updated file paths and function parameters.
task_floded_lands_emi.py: Updated file paths and function parameters.
task_forest_land_emi.py: Updated file paths and function parameters.
task_grassland_emi.py: Updated file paths and function parameters.
task_ind_wastewater_emi.py: Updated file paths and function parameters.
task_iron_steel_emi.py: Updated file paths and function parameters.
task_livestock_enteric_fermentation.py: Updated file paths and function parameters. Added Notes. Removed AK & HI. Created 2023 code (2012-2022 code uses previous code). Commented out Test code.
task_livestock_manure_management.py: Updated file paths and function parameters. Added Notes. Removed AK & HI. Created 2023 code (2012-2022 code uses previous code). Commented out Test code.
task_mobile_comb_emi.py: Updated file paths and function parameters. Updated source for V4.
task_oil_gas_emi.py: Uses Hannah's crosswalk excel doc to map oil/gas emissions generation.
task_petrochemicals_emis.py: Updated file paths and function parameters.
task_rice_emi.py: Updated file paths and function parameters.
task_stat_comb_emi.py: Updated file paths and function parameters. Added lines 84-86: Query for Residential & Biomass fuel type.

Proxy Scripts

global_data/task_download_breweries.py: Original code for downloading brewery data/locations. Can be used separate from domestic wastewater proxy code.
task_abandoned_coal_proxy.py: Updated file paths and function parameters. Updated source for V4. Added ratio to skip_row_list at line 166. Removed ZipFile opening at line 222 since mines is stored as .txt (this may have been updated back to zip file).
task_anaerobic_digestion.py: Updated file paths and function parameters. Updated source for V4. Made Pytask return None to prevent failure.
task_carbides_proxy.py: Updated file paths and function parameters. Updated source for V4.
task_coal_surface_and_under_proxy.py: Updated file paths and function parameters. Updated source for V4. Added num of mines from inventory notebook (line 116). Removed ZipFile opening at line 270 since mines is stored as .txt (this may have been updated back to zip file).
task_coastal_wetlands_proxy.py: Updated file paths and function parameters. Updated source for V4. This is Express; however, the paths were updated.
task_comb_mob_mines.py: Updated file paths and function parameters. Updated source for V4. Removed ZipFile opening at line 44 since mines is stored as .txt (this may have been updated back to zip file).
task_composting_proxy.py: Updated file paths and function parameters. Updated source for V4. This is Express; however, the paths were updated.
task_dask_import_allroads.py: Updated file paths and function parameters. Updated source for V4. Added Progress, Failed, Success, and Retry log files. Added functions to process in batches.
task_iron_steel_proxy.py: Updated file paths and function parameters. Updated source for V4. Added flexible GHGRP Subpart Q read in that either loads file from dir or downloads with API.
task_livestock_proxy.py: Updated file paths and function parameters. Updated source for V4. This is Express; however, the paths were updated.
task_mob_comb_railroads_proxy.py: Updated file paths and function parameters. Updated source for V4. This is Express; however, the paths were updated.
task_peatlands_proxy.py: Updated file paths and function parameters. Updated source for V4. This is Express; however, the paths were updated.
task_petrochemicals_proxy.py: Updated file paths and function parameters. Updated source for V4. Line 75: update usecols. Line 99: added capacity.33 for 2023. Line 105: adjusted dropna year range. Added flexible read in for GHGRP subpart X (either reads from dir or downloads with API if file does not exist). Line 182: added column for next year.
task_raods_proxy.py: Updated file paths and function parameters. Updated source for V4. This is Express; however, the paths were updated. Updated column headers (were previously incorrect for creating NEW files). Previous code checked if files existed (they did) and continued, so code was updated to generate 2023 data. Line 293: Changed join() to merge(). Line 466: Change groupby logic for out_ds. Line 500: Flip Y-axis.
task_stat_comb_proxy.py: Updated file paths and function parameters. Updated source for V4.
task_wastewater_proxy.py: Updated file paths and function parameters. Updated source for V4. This is Express; however, the paths were updated. Line 1211: process all industries and unpack individual variables. Line 1244: changed state_name to state. Left in testing data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants