Skip to content

Instantly share code, notes, and snippets.

View WesIngwersen's full-sized avatar

Dr. Wesley Ingwersen WesIngwersen

View GitHub Profile
@WesIngwersen
WesIngwersen / GHGRP_wNEI_CA_2022.csv
Last active January 12, 2026 23:03
Example combined GHGRP and NEI facility emissions query using StEWI
We can't make this file beautiful and searchable because it's too large.
FacilityID,FlowName,Compartment,FlowAmount,Unit,DataReliability,Source,Year,FRS_ID,SRS_CAS,SRS_ID,GHGRP_ID
6500711,Manganese,air,0.10615694390532002,kg,5.0,NEI,2022,110000474353,7439-96-5,37008,1006861
6500711,Hexane,air,1.7266918892484802,kg,4.999999999999999,NEI,2022,110000474353,110-54-3,47684,1006861
6500711,Formaldehyde,air,4.613481644976821,kg,5.0,NEI,2022,110000474353,50-00-0,49201,1006861
6500711,Ethylene Glycol,air,0.049895160699999996,kg,5.0,NEI,2022,110000474353,107-21-1,47475,1006861
6500711,Ethylene Dichloride,air,0.0074868006145009,kg,5.000000000000001,NEI,2022,110000474353,107-06-2,47485,1006861
6500711,Ethyl Benzene,air,2.6761949830000002,kg,4.999999999999999,NEI,2022,110000474353,100-41-4,94770,1006861
6500711,Elemental Carbon portion of PM2.5-PRI,air,92.29122368406718,kg,2.0,NEI,2022,110000474353,,36834,1006861
6500711,Cobalt,air,0.0154936993122912,kg,2.0,NEI,2022,110000474353,7440-48-4,36830,1006861
6500711,Hydrochloric Acid,air,0.018143694800000002,kg,5.0,NEI,2022,110000474353,7647-01-0,38
@WesIngwersen
WesIngwersen / write_IPCC_from_lciafmt.py
Last active November 23, 2024 01:00
Write IPCC GWPs to csv and openLCA schema JSON-LD
# -*- coding: utf-8 -*-
"""
Retrieve IPCC global warming potential factors in kg CO23 per kg GHG using LCIA Formatter
Map to FEDEFL
Write out with all relevant FEDEFL flows to openLCA schema JSON-LD
Simplify and condense table and write to csv
Output available at http://doi.org/10.23719/1529821
"""
# See https://github.com/USEPA/LCIAformatter/ to install LCIA formatter (lciafmt)
@WesIngwersen
WesIngwersen / StateImportExportfromStateIO.Rmd
Last active October 30, 2023 18:19
State Import Export Data for a Given Year from StateIO Models
---
title: "State Import Export Data for a Given Year from StateIO Models"
author: "Wesley Ingwersen"
date: "2023-10-30"
output:
md_document:
variant: gfm
params:
year: 2020
---
@WesIngwersen
WesIngwersen / gist:3026cf55a30e8f247d8bd7f02f62cbaa
Last active August 14, 2023 16:58
Demonstrating the useeior adjustment procedure for satellite totals to create coefficients in the form of physical value per IO table dollar year

For this example I am running the model "USEEIOv2.1.19-GHG". I'd like to see what happens to the coefficient for Carbon dioxide from the Electric power industry. For convenience I worked right in the pulled useeior code (master branch) and I put the model spec file for that model into the useeior/inst/extdata/modelspecs folder.
Instead of loading the built useeior library, I use devtools to load_all() the functions and data in the package

For building the model, I just first want to run the initial steps to get what is needed for this example.

modelname <- "USEEIOv2.1.19-GHG"