author: Havala O.T. Pye (pye.havala@epa.gov)
date: created 2024-02-16
last updated 2025-04-25
This notebook reads in the data from assembled across HPLC (Xiaoyu Liu), VOC (Ingrid George), and SVOC (Joe Martin) techniques. It provides visualization of the data and propagation to SOA, ozone, and risk endpoints.
Note: Test T2, T3, T4 renamed ink C, B, A for presentation in manuscript
%matplotlib inline
!python -m pip install --user rdkit
1h= Currently Loaded Modules: 1) geos/3.11.2 5) udunits/2.2.28 9) intelpython/3.9.15 2) pandoc/3.1.4 6) gdal/3.6.4 10) ncview/2.1.9 3) jupyterlab/3.0.18 7) proj/9.2.1 11) nco/5.1.4 4) intel/21.4 8) intelmpi/21.4 12) netcdf/4.9.2 >Happy coding! Requirement already satisfied: rdkit in /home/phavala/.local/lib/python3.9/site-packages (2023.9.5) Requirement already satisfied: Pillow in /home/phavala/.local/lib/python3.9/site-packages (from rdkit) (10.1.0) Requirement already satisfied: numpy in /home/local-rhel8/apps/oneapi/intelpython/python3.9/lib/python3.9/site-packages (from rdkit) (1.22.3)
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from datetime import datetime, timedelta, date
from matplotlib.ticker import (MultipleLocator, AutoMinorLocator)
import matplotlib.ticker as ticker
import matplotlib.patches as mpatches
# directories
inputdir = './inputs/' # inputs
outputdir = './output/' # outputs
utildir = './utilities/' # directory where utilities from CRACMM github are downloaded
# date for stamping output files
today = str(date.today())
today = today.replace('-','')
# import utilities from https://github.com/USEPA/CRACMM/
import sys
sys.path.append(utildir)
# Import the python utilities
from mir_estimates import * # includes: get_mir(smiles,koh)
from soa_yields import * # includes: get_soayield(smiles,pvap,molwght)
import cracmm2_mapper as cracmm2 # includes: get_cracmm_roc(smiles,koh,log10cstar) (Version 2)
import cracmm1_mapper as cracmm1 # includes: get_cracmm_roc(smiles,koh,log10cstar) (Version 1)
# Constants
Treference = 298.15 # K
RJmolK = 8.314 # J/molK
# Read excel spreadsheet -- T2 and T3
measfilename = inputdir + 'Final_print_VCP_data.xlsx' #'20240109_print_VCP Data Joe Update 20250407_corrected.xlsx' # Joe's updated
dft23 = pd.read_excel( measfilename, sheet_name = 'Data Analysis', skiprows = 64, nrows = 8, header =1, usecols= 'D:F')
dft23 = dft23.rename(columns={'Unnamed: 3':'species'})
dft23 = dft23.rename(columns={'T2':'T2_emiss_g','T3-VOC Data':'T3_emiss_g'}) # add units and emission label
dft23
| species | T2_emiss_g | T3_emiss_g | |
|---|---|---|---|
| 0 | Formaldehyde | 0.000017 | 0.000019 |
| 1 | Acetaldehyde | 0.000062 | 0.000552 |
| 2 | Unknown as Acetone | 0.000921 | 0.00106 |
| 3 | Butanal | ND | 0.000005 |
| 4 | Hexaldehyde | 0.000015 | 0.000018 |
| 5 | Methanol | 0.03633 | 0.00797 |
| 6 | Isopropyl_Alcohol | 0.00059 | NR |
| 7 | Total SVOCs | 0.017974 | 0.003953 |
# Read spreadsheet T4 data (drop T1)
#filename = inputdir + '20240109_print_VCP Data-For Sharing.xlsx'
dft4 = pd.read_excel( measfilename, sheet_name = 'Data Analysis', skiprows = 79, nrows = 15, header =1, usecols= 'D:G')
dft4 = dft4.rename(columns={'Unnamed: 3':'species'})
dft4 = dft4.rename(columns={'T4-VOC data':'T4_emiss_g'}) # add units and emission label
dft4.drop(columns='T1-No VOC Data', inplace = True)
dft4.drop(columns='T4- HPLC Data', inplace = True)
dft4
| species | T4_emiss_g | |
|---|---|---|
| 0 | Acetaldehyde | 0.000672 |
| 1 | Acetone | 0.002566 |
| 2 | Propionaldehyde | 0.000004 |
| 3 | 2-Butanone (MEK) | 0.008596 |
| 4 | 3-Pentanone | 1.295795 |
| 5 | Benzaldehyde | 0.000003 |
| 6 | Methanol | 0.003933 |
| 7 | Ethanol | 1.181273 |
| 8 | Isopropyl_Alcohol | 0.000861 |
| 9 | Ethyl_Acetate | 0.018519 |
| 10 | Toluene | 0.000013 |
| 11 | Alkane | 0.000327 |
| 12 | PAH | 0.000649 |
| 13 | Glycol | 0.034017 |
| 14 | SubBenzene | 0.006565 |
# get list of unique species, uncomment to produce list for preparing input to dashboard, manually assign representative compounds
#list(pd.concat( [dft23, dft4] ).species.unique())
# combine all test data after dropping rows that aren't species and dropping technique
dfmeasured = pd.merge(dft23,dft4, how='outer',on='species')
dfmeasured
| species | T2_emiss_g | T3_emiss_g | T4_emiss_g | |
|---|---|---|---|---|
| 0 | Formaldehyde | 0.000017 | 0.000019 | NaN |
| 1 | Acetaldehyde | 0.000062 | 0.000552 | 0.000672 |
| 2 | Unknown as Acetone | 0.000921 | 0.00106 | NaN |
| 3 | Butanal | ND | 0.000005 | NaN |
| 4 | Hexaldehyde | 0.000015 | 0.000018 | NaN |
| 5 | Methanol | 0.03633 | 0.00797 | 0.003933 |
| 6 | Isopropyl_Alcohol | 0.00059 | NR | 0.000861 |
| 7 | Total SVOCs | 0.017974 | 0.003953 | NaN |
| 8 | Acetone | NaN | NaN | 0.002566 |
| 9 | Propionaldehyde | NaN | NaN | 0.000004 |
| 10 | 2-Butanone (MEK) | NaN | NaN | 0.008596 |
| 11 | 3-Pentanone | NaN | NaN | 1.295795 |
| 12 | Benzaldehyde | NaN | NaN | 0.000003 |
| 13 | Ethanol | NaN | NaN | 1.181273 |
| 14 | Ethyl_Acetate | NaN | NaN | 0.018519 |
| 15 | Toluene | NaN | NaN | 0.000013 |
| 16 | Alkane | NaN | NaN | 0.000327 |
| 17 | PAH | NaN | NaN | 0.000649 |
| 18 | Glycol | NaN | NaN | 0.034017 |
| 19 | SubBenzene | NaN | NaN | 0.006565 |
# Read table of representative structures manually assigned by Havala
filename = inputdir + '20240222_representativestructures.xlsx'
repstruc = pd.read_excel( filename ) # representative names are input to dashboard
repstruc
| species | representative | |
|---|---|---|
| 0 | Formaldehyde | Formaldehyde |
| 1 | Acetaldehyde | Acetaldehyde |
| 2 | Acetone | Acetone |
| 3 | Butanal | Butanal |
| 4 | Hexaldehyde | Hexaldehyde |
| 5 | Methanol | Methanol |
| 6 | Isopropyl_Alcohol | Isopropyl Alcohol |
| 7 | Total SVOCs | diethylene glycol |
| 8 | Propionaldehyde | Propionaldehyde |
| 9 | Benzaldehyde | Benzaldehyde |
| 10 | 2-Butanone (MEK) | 2-Butanone |
| 11 | 3-Pentanone | 3-Pentanone |
| 12 | Ethanol | Ethanol |
| 13 | Ethyl_Acetate | Ethyl Acetate |
| 14 | Toluene | Toluene |
| 15 | Alkane | octane |
| 16 | PAH | 1H-Indene-3-carboxylic acid |
| 17 | Glycol | Glycol |
| 18 | SubBenzene | 1,2,3-trimethylbenzene |
| 19 | Unknown as Acetone | acetone |
# Append representative and print (review by team)
dfmeasured=pd.merge(dfmeasured,repstruc,on="species")
nspc = dfmeasured.shape[0]
dfmeasured
| species | T2_emiss_g | T3_emiss_g | T4_emiss_g | representative | |
|---|---|---|---|---|---|
| 0 | Formaldehyde | 0.000017 | 0.000019 | NaN | Formaldehyde |
| 1 | Acetaldehyde | 0.000062 | 0.000552 | 0.000672 | Acetaldehyde |
| 2 | Unknown as Acetone | 0.000921 | 0.00106 | NaN | acetone |
| 3 | Butanal | ND | 0.000005 | NaN | Butanal |
| 4 | Hexaldehyde | 0.000015 | 0.000018 | NaN | Hexaldehyde |
| 5 | Methanol | 0.03633 | 0.00797 | 0.003933 | Methanol |
| 6 | Isopropyl_Alcohol | 0.00059 | NR | 0.000861 | Isopropyl Alcohol |
| 7 | Total SVOCs | 0.017974 | 0.003953 | NaN | diethylene glycol |
| 8 | Acetone | NaN | NaN | 0.002566 | Acetone |
| 9 | Propionaldehyde | NaN | NaN | 0.000004 | Propionaldehyde |
| 10 | 2-Butanone (MEK) | NaN | NaN | 0.008596 | 2-Butanone |
| 11 | 3-Pentanone | NaN | NaN | 1.295795 | 3-Pentanone |
| 12 | Benzaldehyde | NaN | NaN | 0.000003 | Benzaldehyde |
| 13 | Ethanol | NaN | NaN | 1.181273 | Ethanol |
| 14 | Ethyl_Acetate | NaN | NaN | 0.018519 | Ethyl Acetate |
| 15 | Toluene | NaN | NaN | 0.000013 | Toluene |
| 16 | Alkane | NaN | NaN | 0.000327 | octane |
| 17 | PAH | NaN | NaN | 0.000649 | 1H-Indene-3-carboxylic acid |
| 18 | Glycol | NaN | NaN | 0.034017 | Glycol |
| 19 | SubBenzene | NaN | NaN | 0.006565 | 1,2,3-trimethylbenzene |
# Match with output from https://comptox.epa.gov/dashboard/batch-search
filename = inputdir + 'CCD-Batch-Search_2024-02-22_04_46_48.xlsx'
ccd = pd.read_excel( filename, sheet_name = 'Main Data')
ccd.drop_duplicates( subset = 'INPUT', inplace = True) # remove any duplicates
dfmeasured = pd.merge(dfmeasured,ccd,left_on='representative',right_on='INPUT')
if( dfmeasured.shape[0] != nspc ):
print('Number of species before mapping '+ str(nspc) +' does not match after reading comptox output. Correction needed.')
else:
print(str(nspc)+' species mapped to properties')
20 species mapped to properties
/home/phavala/.local/lib/python3.9/site-packages/openpyxl/styles/stylesheet.py:226: UserWarning: Workbook contains no default style, apply openpyxl's default
warn("Workbook contains no default style, apply openpyxl's default")
# display combined measurements and properties
pd.set_option('display.max_columns', None)
dfmeasured # display
| species | T2_emiss_g | T3_emiss_g | T4_emiss_g | representative | INPUT | FOUND_BY | DTXSID | PREFERRED_NAME | DTXCID | CASRN | SMILES | MOLECULAR_FORMULA | AVERAGE_MASS | BIOCONCENTRATION_FACTOR_TEST_PRED | BOILING_POINT_DEGC_TEST_PRED | 48HR_DAPHNIA_LC50_MOL/L_TEST_PRED | DENSITY_G/CM^3_TEST_PRED | DEVTOX_TEST_PRED | 96HR_FATHEAD_MINNOW_MOL/L_TEST_PRED | FLASH_POINT_DEGC_TEST_PRED | MELTING_POINT_DEGC_TEST_PRED | AMES_MUTAGENICITY_TEST_PRED | ORAL_RAT_LD50_MOL/KG_TEST_PRED | SURFACE_TENSION_DYN/CM_TEST_PRED | THERMAL_CONDUCTIVITY_MW/(M*K)_TEST_PRED | TETRAHYMENA_PYRIFORMIS_IGC50_MOL/L_TEST_PRED | VISCOSITY_CP_CP_TEST_PRED | VAPOR_PRESSURE_MMHG_TEST_PRED | WATER_SOLUBILITY_MOL/L_TEST_PRED | ATMOSPHERIC_HYDROXYLATION_RATE_(AOH)_CM3/MOLECULE*SEC_OPERA_PRED | BIOCONCENTRATION_FACTOR_OPERA_PRED | BIODEGRADATION_HALF_LIFE_DAYS_DAYS_OPERA_PRED | BOILING_POINT_DEGC_OPERA_PRED | HENRYS_LAW_ATM-M3/MOLE_OPERA_PRED | OPERA_KM_DAYS_OPERA_PRED | OCTANOL_AIR_PARTITION_COEFF_LOGKOA_OPERA_PRED | SOIL_ADSORPTION_COEFFICIENT_KOC_L/KG_OPERA_PRED | OCTANOL_WATER_PARTITION_LOGP_OPERA_PRED | MELTING_POINT_DEGC_OPERA_PRED | OPERA_PKAA_OPERA_PRED | OPERA_PKAB_OPERA_PRED | VAPOR_PRESSURE_MMHG_OPERA_PRED | WATER_SOLUBILITY_MOL/L_OPERA_PRED | LOGD5.5 | LOGD7.4 | READY_BIO_DEG | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | Formaldehyde | 0.000017 | 0.000019 | NaN | Formaldehyde | Formaldehyde | Approved Name | DTXSID7020637 | Formaldehyde | DTXCID30637 | 50-00-0 | C=O | CH2O | 30.026 | -16.012 | 0.861 | -18.267 | -79.361 | 0.362 | 22.056 | 164.885 | 0.254097 | 1221.800000 | 9.571940 | 9.342880e-12 | 1.72988 | 8.20857 | -19.0454 | 3.494710e-07 | 0.224902 | 1.20597 | 2.72646 | 0.349206 | -105.2860 | 1.15 | 824.979000 | 14.662500 | 0.35 | 0.35 | 1 | |||||||
| 1 | Acetaldehyde | 0.000062 | 0.000552 | 0.000672 | Acetaldehyde | Acetaldehyde | Approved Name | DTXSID5039224 | Acetaldehyde | DTXCID202 | 75-07-0 | CC=O | C2H4O | 44.053 | 31.585 | 0.010765 | 0.906 | 0.491 | 0.005012 | -0.414 | -45.573 | 0.107 | 0.018197 | 23.046 | 149.31 | 0.014158 | 0.285759 | 420.727000 | 4.698940 | 1.579550e-11 | 2.45935 | 7.56818 | 20.1228 | 6.609010e-05 | 0.169684 | 1.79446 | 2.57283 | -0.338130 | -122.8790 | 16.76 | -0.57 | 898.259000 | 16.051800 | -0.34 | -0.34 | 1 | |
| 2 | Unknown as Acetone | 0.000921 | 0.00106 | NaN | acetone | acetone | Approved Name | DTXSID8021482 | Acetone | DTXCID101482 | 67-64-1 | CC(C)=O | C3H6O | 58.080 | 1.91426 | 41.374 | 0.021928 | 0.837 | 0.462 | 0.036308 | 9.637 | -63.606 | -0.029 | 0.062661 | 23.159 | 147.469 | 0.068391 | 0.319154 | 250.035000 | 5.623410 | 2.201470e-13 | 1.99247 | 7.56577 | 55.6196 | 3.532240e-05 | 0.160491 | 2.32758 | 3.65480 | -0.237520 | -96.2441 | 19.13 | 232.690000 | 17.063100 | -0.24 | -0.24 | 1 | |
| 3 | Butanal | ND | 0.000005 | NaN | Butanal | Butanal | Expert Validated Synonym | DTXSID8021513 | Butyraldehyde | DTXCID601513 | 123-72-8 | CCCC=O | C4H8O | 72.107 | 96.408 | 0.001439 | 0.852 | 0.582 | 0.000214 | 9.308 | -53.045 | 0.489 | 0.01574 | 23.573 | 145.26 | 0.001365 | 0.466659 | 100.231000 | 0.603949 | 2.351290e-11 | 5.29042 | 3.67368 | 74.7617 | 1.143670e-04 | 0.138848 | 3.18740 | 10.84970 | 0.879054 | -98.4607 | 111.140000 | 0.978317 | 0.88 | 0.88 | 1 | |||
| 4 | Hexaldehyde | 0.000015 | 0.000018 | NaN | Hexaldehyde | Hexaldehyde | Expert Validated Synonym | DTXSID2021604 | Hexanal | DTXCID901604 | 66-25-1 | CCCCCC=O | C6H12O | 100.161 | 126.339 | 0.000484 | 0.843 | 0.586 | 0.000192 | 38.107 | -39.764 | 0.682 | 0.012823 | 24.456 | 140.023 | 0.00075 | 0.739605 | 4.591980 | 0.040926 | 3.167590e-11 | 11.05860 | 4.44523 | 130.8260 | 2.120130e-04 | 0.352448 | 4.15557 | 18.40280 | 1.778440 | -56.0859 | 11.356000 | 0.052127 | 1.78 | 1.78 | 1 | |||
| 5 | Methanol | 0.03633 | 0.00797 | 0.003933 | Methanol | Methanol | Approved Name | DTXSID2021731 | Methanol | DTXCID801731 | 67-56-1 | CO | CH4O | 32.042 | 0.530884 | 17.821 | 0.009484 | 0.897 | 0.035156 | -6.582 | -75.959 | 0.191 | 21.674 | 165.053 | 0.183654 | 0.722770 | 425.598000 | 2.437810 | 9.471120e-13 | 1.54130 | 7.57468 | 64.7295 | 4.557950e-06 | 0.120694 | 2.86273 | 2.75443 | -0.768744 | -97.5702 | 10.29 | 126.324000 | 32.643400 | -0.77 | -0.77 | 1 | |||
| 6 | Isopropyl_Alcohol | 0.00059 | NR | 0.000861 | Isopropyl Alcohol | Isopropyl Alcohol | Expert Validated Synonym | DTXSID7020762 | Isopropanol | DTXCID50762 | 67-63-0 | CC(C)O | C3H8O | 60.096 | 2.12814 | 83.075 | 0.013428 | 0.863 | 0.492 | 0.035892 | 6.163 | -45.893 | 0.001 | 0.053703 | 26.22 | 157.829 | 0.059156 | 2.023020 | 15.958800 | 4.786300 | 5.077690e-12 | 4.59819 | 7.53284 | 82.3951 | 8.088620e-06 | 0.079930 | 3.47701 | 3.43640 | 0.051948 | -89.6414 | 11.68 | 44.944600 | 9.005230 | 0.05 | 0.05 | 1 | |
| 7 | Total SVOCs | 0.017974 | 0.003953 | NaN | diethylene glycol | diethylene glycol | Approved Name | DTXSID8020462 | Diethylene glycol | DTXCID20462 | 111-46-6 | OCCOCCO | C4H10O3 | 106.121 | 0.656145 | 199.851 | 0.053951 | 1.076 | 0.215 | 0.119124 | 85.176 | -6.591 | 0.263 | 0.038282 | 37.899 | 191.896 | 0.119674 | 18.879900 | 0.007447 | 5.395110 | 2.990660e-11 | 3.43715 | 6.13275 | 245.6130 | 2.960770e-09 | 0.071864 | 7.13012 | 4.08583 | -1.093890 | -10.4231 | 7.06 | 0.005701 | 9.417610 | -2.66 | -1.25 | 1 | |
| 8 | Acetone | NaN | NaN | 0.002566 | Acetone | Acetone | Approved Name | DTXSID8021482 | Acetone | DTXCID101482 | 67-64-1 | CC(C)=O | C3H6O | 58.080 | 1.91426 | 41.374 | 0.021928 | 0.837 | 0.462 | 0.036308 | 9.637 | -63.606 | -0.029 | 0.062661 | 23.159 | 147.469 | 0.068391 | 0.319154 | 250.035000 | 5.623410 | 2.201470e-13 | 1.99247 | 7.56577 | 55.6196 | 3.532240e-05 | 0.160491 | 2.32758 | 3.65480 | -0.237520 | -96.2441 | 19.13 | 232.690000 | 17.063100 | -0.24 | -0.24 | 1 | |
| 9 | Propionaldehyde | NaN | NaN | 0.000004 | Propionaldehyde | Propionaldehyde | Expert Validated Synonym | DTXSID2021658 | Propanal | DTXCID001658 | 123-38-6 | CCC=O | C3H6O | 58.080 | 58.534 | 0.001959 | 0.843 | 0.629 | 0.000536 | 2.396 | -56.789 | 0.26 | 0.005875 | 22.728 | 149.586 | 0.003273 | 0.437522 | 221.820000 | 1.566750 | 1.961160e-11 | 5.49222 | 3.67945 | 48.0513 | 7.334760e-05 | 0.163907 | 2.90224 | 5.16901 | 0.589061 | -80.2497 | 314.891000 | 4.453230 | 0.59 | 0.59 | 1 | |||
| 10 | 2-Butanone (MEK) | NaN | NaN | 0.008596 | 2-Butanone | 2-Butanone | Expert Validated Synonym | DTXSID3021516 | Methyl ethyl ketone | DTXCID801516 | 78-93-3 | CCC(C)=O | C4H8O | 72.107 | 2.66686 | 85.913 | 0.004624 | 0.877 | 0.481 | 0.010351 | 11.812 | -54.197 | 0.089 | 0.014723 | 24.679 | 144.036 | 0.022856 | 0.356451 | 106.170000 | 1.137630 | 1.153900e-12 | 4.09711 | 3.66957 | 79.3395 | 5.705120e-05 | 0.136632 | 2.72588 | 15.89840 | 0.291427 | -86.3934 | 90.624500 | 3.183170 | 0.29 | 0.29 | 1 | ||
| 11 | 3-Pentanone | NaN | NaN | 1.295795 | 3-Pentanone | 3-Pentanone | Approved Name | DTXSID6021820 | 3-Pentanone | DTXCID301820 | 96-22-0 | CCC(=O)CC | C5H10O | 86.134 | 3.75837 | 104.735 | 0.001614 | 0.833 | 0.497 | 0.004775 | 19.233 | -59.074 | 0.198 | 0.016033 | 24.846 | 142.618 | 0.0139 | 0.432514 | 32.885200 | 0.381944 | 2.004050e-12 | 3.96080 | 5.24613 | 102.0200 | 5.053810e-05 | 0.179811 | 3.20144 | 19.53570 | 0.906191 | -42.0728 | 37.488700 | 0.546379 | 0.91 | 0.91 | 1 | ||
| 12 | Benzaldehyde | NaN | NaN | 0.000003 | Benzaldehyde | Benzaldehyde | Approved Name | DTXSID8039241 | Benzaldehyde | DTXCID90134 | 100-52-7 | O=CC1=CC=CC=C1 | C7H6O | 106.124 | 6.16 | 185.010 | 0.000151 | 1.090 | 0.19 | 0.000158 | 73.440 | 6.480 | 0.04 | 0.012023 | 41.15 | 143.85 | 0.001288 | 1.412540 | 0.281838 | 0.035481 | 1.291460e-11 | 12.52050 | 5.92924 | 179.1020 | 2.673770e-05 | 0.202421 | 3.88581 | 32.50930 | 1.474340 | -25.5658 | 1.263430 | 0.062603 | 1.47 | 1.47 | 1 | ||
| 13 | Ethanol | NaN | NaN | 1.181273 | Ethanol | Ethanol | Approved Name | DTXSID9020584 | Ethanol | DTXCID30584 | 64-17-5 | CCO | C2H6O | 46.069 | 1.25893 | 68.054 | 0.028249 | 0.912 | 0.455 | 0.017418 | 10.828 | -69.464 | -0.006 | 0.01714 | 24.095 | 182.077 | 0.103753 | 1.531090 | 31.550000 | 6.516280 | 3.277880e-12 | 1.81310 | 4.59705 | 78.2185 | 5.013510e-06 | 0.105204 | 3.24479 | 1.59008 | -0.309717 | -114.0380 | 12.31 | 58.854800 | 18.103000 | -0.31 | -0.31 | 1 | |
| 14 | Ethyl_Acetate | NaN | NaN | 0.018519 | Ethyl Acetate | Ethyl Acetate | Approved Name | DTXSID1022001 | Ethyl acetate | DTXCID602001 | 141-78-6 | CCOC(C)=O | C4H8O2 | 88.106 | 2.61216 | 81.196 | 0.002249 | 0.926 | 0.587 | 0.002004 | 14.040 | -70.237 | 0.141 | 0.06223 | 23.931 | 142.058 | 0.018197 | 0.465586 | 75.162300 | 0.475335 | 1.603440e-12 | 3.23156 | 4.12611 | 78.4376 | 1.348000e-04 | 0.180171 | 2.69862 | 18.17440 | 0.731494 | -83.9003 | 93.156800 | 0.911820 | 0.73 | 0.73 | 1 | ||
| 15 | Toluene | NaN | NaN | 0.000013 | Toluene | Toluene | Expert Validated Synonym | DTXSID7021360 | 1-Methylbenzene | DTXCID501360 | 108-88-3 | CC1=CC=CC=C1 | C7H8 | 92.141 | 66.55 | 128.360 | 0.000229 | 0.900 | 0.28 | 0.000339 | 28.260 | -33.640 | -0.02 | 0.016982 | 29.18 | 132.42 | 0.001122 | 0.676083 | 23.988300 | 0.004074 | 5.973360e-12 | 8.33841 | 2.01480 | 110.6700 | 6.626450e-03 | 0.237095 | 3.49442 | 117.11500 | 2.728790 | -93.2830 | 28.316500 | 0.005918 | 2.73 | 2.73 | 1 | ||
| 16 | Alkane | NaN | NaN | 0.000327 | octane | octane | Approved Name | DTXSID0026882 | Octane | DTXCID406882 | 111-65-9 | CCCCCCCC | C8H18 | 114.232 | 580.764 | 130.843 | 0.00003 | 0.743 | 0.487 | 0.000016 | 24.976 | -71.701 | 0.039628 | 21.263 | 124.078 | 0.000105 | 0.500035 | 9.246980 | 0.000038 | 8.662630e-12 | 312.32300 | 8.98873 | 125.4960 | 3.655730e-01 | 4.112610 | 3.39317 | 191.49500 | 5.178630 | -57.4803 | 14.005100 | 0.000006 | 5.18 | 5.18 | 1 | |||
| 17 | PAH | NaN | NaN | 0.000649 | 1H-Indene-3-carboxylic acid | 1H-Indene-3-carboxylic acid | Approved Name | DTXSID20161940 | 1H-Indene-3-carboxylic acid | DTXCID5084431 | 14209-41-7 | OC(=O)C1=CCC2=CC=CC=C12 | C10H8O2 | 160.172 | 6.223 | 298.031 | 0.000202 | 1.261 | 0.606 | 0.000052 | 150.849 | 110.977 | 0.43 | 15.703600 | 0.000062 | 0.001832 | 3.070700e-11 | 4.01565 | 3.10224 | 302.6460 | 1.252300e-08 | 0.110657 | 8.38386 | 77.89030 | 2.150060 | 104.0450 | 5.29 | 0.000060 | 0.001932 | 1.73 | 0.04 | 1 | |||||
| 18 | Glycol | NaN | NaN | 0.034017 | Glycol | Glycol | Synonym | DTXSID0021206 | 1,2-Propylene glycol | DTXCID901206 | 57-55-6 | CC(O)CO | C3H8O2 | 76.095 | 1.07647 | 168.555 | 0.026915 | 1.010 | 0.545 | 0.095061 | 70.374 | -21.625 | 0.196 | 0.053456 | 33.094 | 184.634 | 0.152055 | 12.618300 | 0.295121 | 4.315190 | 1.201600e-11 | 3.38004 | 4.26800 | 187.6690 | 6.054780e-08 | 0.059302 | 6.73741 | 2.30480 | -0.918877 | -59.8063 | 11.47 | 0.127532 | 13.154500 | -0.92 | -0.92 | 1 | |
| 19 | SubBenzene | NaN | NaN | 0.006565 | 1,2,3-trimethylbenzene | 1,2,3-trimethylbenzene | Approved Name | DTXSID8047769 | 1,2,3-Trimethylbenzene | DTXCID7027750 | 526-73-8 | CC1=CC=CC(C)=C1C | C9H12 | 120.195 | 173.38 | 172.792 | 0.000047 | 0.877 | 0.408 | 0.000111 | 48.824 | -17.530 | 0.043351 | 29.197 | 126.731 | 0.000335 | 1.119440 | 1.428890 | 0.001422 | 3.273340e-11 | 191.42700 | 4.01295 | 170.0170 | 4.442570e-03 | 0.604281 | 4.53535 | 631.60200 | 3.625410 | -38.3499 | 1.687560 | 0.000619 | 3.63 | 3.63 | 0 |
# Metadata available: list column names
dfmeasured.columns
Index(['species', 'T2_emiss_g', 'T3_emiss_g', 'T4_emiss_g', 'representative',
'INPUT', 'FOUND_BY', 'DTXSID', 'PREFERRED_NAME', 'DTXCID', 'CASRN',
'SMILES', 'MOLECULAR_FORMULA', 'AVERAGE_MASS',
'BIOCONCENTRATION_FACTOR_TEST_PRED', 'BOILING_POINT_DEGC_TEST_PRED',
'48HR_DAPHNIA_LC50_MOL/L_TEST_PRED', 'DENSITY_G/CM^3_TEST_PRED',
'DEVTOX_TEST_PRED', '96HR_FATHEAD_MINNOW_MOL/L_TEST_PRED',
'FLASH_POINT_DEGC_TEST_PRED', 'MELTING_POINT_DEGC_TEST_PRED',
'AMES_MUTAGENICITY_TEST_PRED', 'ORAL_RAT_LD50_MOL/KG_TEST_PRED',
'SURFACE_TENSION_DYN/CM_TEST_PRED',
'THERMAL_CONDUCTIVITY_MW/(M*K)_TEST_PRED',
'TETRAHYMENA_PYRIFORMIS_IGC50_MOL/L_TEST_PRED',
'VISCOSITY_CP_CP_TEST_PRED', 'VAPOR_PRESSURE_MMHG_TEST_PRED',
'WATER_SOLUBILITY_MOL/L_TEST_PRED',
'ATMOSPHERIC_HYDROXYLATION_RATE_(AOH)_CM3/MOLECULE*SEC_OPERA_PRED',
'BIOCONCENTRATION_FACTOR_OPERA_PRED',
'BIODEGRADATION_HALF_LIFE_DAYS_DAYS_OPERA_PRED',
'BOILING_POINT_DEGC_OPERA_PRED', 'HENRYS_LAW_ATM-M3/MOLE_OPERA_PRED',
'OPERA_KM_DAYS_OPERA_PRED',
'OCTANOL_AIR_PARTITION_COEFF_LOGKOA_OPERA_PRED',
'SOIL_ADSORPTION_COEFFICIENT_KOC_L/KG_OPERA_PRED',
'OCTANOL_WATER_PARTITION_LOGP_OPERA_PRED',
'MELTING_POINT_DEGC_OPERA_PRED', 'OPERA_PKAA_OPERA_PRED',
'OPERA_PKAB_OPERA_PRED', 'VAPOR_PRESSURE_MMHG_OPERA_PRED',
'WATER_SOLUBILITY_MOL/L_OPERA_PRED', 'LOGD5.5', 'LOGD7.4',
'READY_BIO_DEG'],
dtype='object')
# data file last updated 4/23 ("HEM Toxicity Value files" https://www.epa.gov/fera/download-human-exposure-model-hem)
dfdose = pd.read_excel(inputdir + "Dose_Response_Library.xlsx",usecols="A:P") # cols after P are shrunk/hidden so don't use ,converters={'CAS No.':str}; from website
# some hyphens retained, some not, get rid of all
dfdose=dfdose.dropna(subset=['CAS No.'])
dfdose['CAS Nohyp']=dfdose['CAS No.'].astype(str).str.replace('-','')
dfdose=dfdose.dropna(subset=['CAS Nohyp']) # drop species without CAS--its just a few mixtures
dfdose.rename(columns={"Pollutant": "HAP Pollutant"},inplace=True)
dfdose.rename(columns={"Pollutant Group": "HAP Group"},inplace=True)
dfdose
| HAP Pollutant | HAP Group | CAS No. | URE\n1/(ug/m3) | RFC\n(mg/m3) | AEGL-1 (1-hr)\n(mg/m3) | AEGL-1 (8-hr)\n(mg/m3) | AEGL-2 (1-hr)\n(mg/m3) | AEGL-2 (8-hr)\n(mg/m3) | ERPG-1\n(mg/m3) | ERPG-2\n(mg/m3) | MRL\n(mg/m3) | REL\n(mg/m3) | IDLH-10\n(mg/m3) | TEEL-0\n(mg/m3) | TEEL-1\n(mg/m3) | CAS Nohyp | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 1,1,1-Trichloroethane | 1,1,1-Trichloroethane | 71556 | 0.000000 | 5.0 | 1300.0 | 1300.0 | 3300 | 1700.00 | 1900.0 | 3800.0 | 11.00 | 68.0 | NaN | NaN | NaN | 71556 |
| 1 | 1,1,2,2-Tetrachloroethane | 1,1,2,2-Tetrachloroethane | 79345 | NaN | 0.0 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 79345 |
| 2 | 1,1,2-Trichloroethane | 1,1,2-Trichloroethane | 79005 | 0.000016 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 0.16 | NaN | NaN | NaN | NaN | 79005 |
| 3 | 1,1-Dimethylhydrazine | 1,1-Dimethylhydrazine | 57147 | 0.000000 | 0.0 | NaN | NaN | 7.4 | 0.93 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 57147 |
| 4 | alpha-Hexachlorocyclohexane (a-HCH) | 1,2,3,4,5,6-Hexachlorocyclohexane (All Stereo ... | 319846 | 0.001800 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 319846 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 474 | 3-Methoxy-1-propanol | Glycol Ethers | 1589497 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 1589497 |
| 475 | Di(ethylene glycol monobutyl ether) phthalate | Glycol Ethers | 16672392 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 16672392 |
| 476 | Diethylene glycol dibenzoate | Glycol Ethers | 120558 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 120558 |
| 477 | Ethylene glycol 2-ethylhexyl ether | Glycol Ethers | 1559-35-9 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 1559359 |
| 478 | Ethylene glycol monovinyl ether | Glycol Ethers | 764-48-7 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 764487 |
468 rows × 17 columns
# Format the dashboard CAS numbers to have not hyphens
dfmeasured['CAS Nohyp']=dfmeasured['CASRN'].astype(str).str.replace('-','')
# add URE and RFC onto measured data
dfmeasured = pd.merge(dfmeasured, dfdose, how="left", on = "CAS Nohyp", suffixes = ('','_dose' ) )
dfmeasured
| species | T2_emiss_g | T3_emiss_g | T4_emiss_g | representative | INPUT | FOUND_BY | DTXSID | PREFERRED_NAME | DTXCID | CASRN | SMILES | MOLECULAR_FORMULA | AVERAGE_MASS | BIOCONCENTRATION_FACTOR_TEST_PRED | BOILING_POINT_DEGC_TEST_PRED | 48HR_DAPHNIA_LC50_MOL/L_TEST_PRED | DENSITY_G/CM^3_TEST_PRED | DEVTOX_TEST_PRED | 96HR_FATHEAD_MINNOW_MOL/L_TEST_PRED | FLASH_POINT_DEGC_TEST_PRED | MELTING_POINT_DEGC_TEST_PRED | AMES_MUTAGENICITY_TEST_PRED | ORAL_RAT_LD50_MOL/KG_TEST_PRED | SURFACE_TENSION_DYN/CM_TEST_PRED | THERMAL_CONDUCTIVITY_MW/(M*K)_TEST_PRED | TETRAHYMENA_PYRIFORMIS_IGC50_MOL/L_TEST_PRED | VISCOSITY_CP_CP_TEST_PRED | VAPOR_PRESSURE_MMHG_TEST_PRED | WATER_SOLUBILITY_MOL/L_TEST_PRED | ATMOSPHERIC_HYDROXYLATION_RATE_(AOH)_CM3/MOLECULE*SEC_OPERA_PRED | BIOCONCENTRATION_FACTOR_OPERA_PRED | BIODEGRADATION_HALF_LIFE_DAYS_DAYS_OPERA_PRED | BOILING_POINT_DEGC_OPERA_PRED | HENRYS_LAW_ATM-M3/MOLE_OPERA_PRED | OPERA_KM_DAYS_OPERA_PRED | OCTANOL_AIR_PARTITION_COEFF_LOGKOA_OPERA_PRED | SOIL_ADSORPTION_COEFFICIENT_KOC_L/KG_OPERA_PRED | OCTANOL_WATER_PARTITION_LOGP_OPERA_PRED | MELTING_POINT_DEGC_OPERA_PRED | OPERA_PKAA_OPERA_PRED | OPERA_PKAB_OPERA_PRED | VAPOR_PRESSURE_MMHG_OPERA_PRED | WATER_SOLUBILITY_MOL/L_OPERA_PRED | LOGD5.5 | LOGD7.4 | READY_BIO_DEG | CAS Nohyp | HAP Pollutant | HAP Group | CAS No. | URE\n1/(ug/m3) | RFC\n(mg/m3) | AEGL-1 (1-hr)\n(mg/m3) | AEGL-1 (8-hr)\n(mg/m3) | AEGL-2 (1-hr)\n(mg/m3) | AEGL-2 (8-hr)\n(mg/m3) | ERPG-1\n(mg/m3) | ERPG-2\n(mg/m3) | MRL\n(mg/m3) | REL\n(mg/m3) | IDLH-10\n(mg/m3) | TEEL-0\n(mg/m3) | TEEL-1\n(mg/m3) | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | Formaldehyde | 0.000017 | 0.000019 | NaN | Formaldehyde | Formaldehyde | Approved Name | DTXSID7020637 | Formaldehyde | DTXCID30637 | 50-00-0 | C=O | CH2O | 30.026 | -16.012 | 0.861 | -18.267 | -79.361 | 0.362 | 22.056 | 164.885 | 0.254097 | 1221.800000 | 9.571940 | 9.342880e-12 | 1.72988 | 8.20857 | -19.0454 | 3.494710e-07 | 0.224902 | 1.20597 | 2.72646 | 0.349206 | -105.2860 | 1.15 | 824.979000 | 14.662500 | 0.35 | 0.35 | 1 | 50000 | Formaldehyde | Formaldehyde | 50000 | 0.000013 | 0.0098 | 1.1 | 1.1 | 17 | 17.0 | 1.2 | 12.0 | 0.049 | 0.055 | NaN | NaN | NaN | |||||||
| 1 | Acetaldehyde | 0.000062 | 0.000552 | 0.000672 | Acetaldehyde | Acetaldehyde | Approved Name | DTXSID5039224 | Acetaldehyde | DTXCID202 | 75-07-0 | CC=O | C2H4O | 44.053 | 31.585 | 0.010765 | 0.906 | 0.491 | 0.005012 | -0.414 | -45.573 | 0.107 | 0.018197 | 23.046 | 149.31 | 0.014158 | 0.285759 | 420.727000 | 4.698940 | 1.579550e-11 | 2.45935 | 7.56818 | 20.1228 | 6.609010e-05 | 0.169684 | 1.79446 | 2.57283 | -0.338130 | -122.8790 | 16.76 | -0.57 | 898.259000 | 16.051800 | -0.34 | -0.34 | 1 | 75070 | Acetaldehyde | Acetaldehyde | 75070 | 0.000002 | 0.0090 | 81.0 | 81.0 | 490 | 200.0 | 18.0 | 360.0 | NaN | 0.470 | NaN | NaN | NaN | |
| 2 | Unknown as Acetone | 0.000921 | 0.00106 | NaN | acetone | acetone | Approved Name | DTXSID8021482 | Acetone | DTXCID101482 | 67-64-1 | CC(C)=O | C3H6O | 58.080 | 1.91426 | 41.374 | 0.021928 | 0.837 | 0.462 | 0.036308 | 9.637 | -63.606 | -0.029 | 0.062661 | 23.159 | 147.469 | 0.068391 | 0.319154 | 250.035000 | 5.623410 | 2.201470e-13 | 1.99247 | 7.56577 | 55.6196 | 3.532240e-05 | 0.160491 | 2.32758 | 3.65480 | -0.237520 | -96.2441 | 19.13 | 232.690000 | 17.063100 | -0.24 | -0.24 | 1 | 67641 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | |
| 3 | Butanal | ND | 0.000005 | NaN | Butanal | Butanal | Expert Validated Synonym | DTXSID8021513 | Butyraldehyde | DTXCID601513 | 123-72-8 | CCCC=O | C4H8O | 72.107 | 96.408 | 0.001439 | 0.852 | 0.582 | 0.000214 | 9.308 | -53.045 | 0.489 | 0.01574 | 23.573 | 145.26 | 0.001365 | 0.466659 | 100.231000 | 0.603949 | 2.351290e-11 | 5.29042 | 3.67368 | 74.7617 | 1.143670e-04 | 0.138848 | 3.18740 | 10.84970 | 0.879054 | -98.4607 | 111.140000 | 0.978317 | 0.88 | 0.88 | 1 | 123728 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | |||
| 4 | Hexaldehyde | 0.000015 | 0.000018 | NaN | Hexaldehyde | Hexaldehyde | Expert Validated Synonym | DTXSID2021604 | Hexanal | DTXCID901604 | 66-25-1 | CCCCCC=O | C6H12O | 100.161 | 126.339 | 0.000484 | 0.843 | 0.586 | 0.000192 | 38.107 | -39.764 | 0.682 | 0.012823 | 24.456 | 140.023 | 0.00075 | 0.739605 | 4.591980 | 0.040926 | 3.167590e-11 | 11.05860 | 4.44523 | 130.8260 | 2.120130e-04 | 0.352448 | 4.15557 | 18.40280 | 1.778440 | -56.0859 | 11.356000 | 0.052127 | 1.78 | 1.78 | 1 | 66251 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | |||
| 5 | Methanol | 0.03633 | 0.00797 | 0.003933 | Methanol | Methanol | Approved Name | DTXSID2021731 | Methanol | DTXCID801731 | 67-56-1 | CO | CH4O | 32.042 | 0.530884 | 17.821 | 0.009484 | 0.897 | 0.035156 | -6.582 | -75.959 | 0.191 | 21.674 | 165.053 | 0.183654 | 0.722770 | 425.598000 | 2.437810 | 9.471120e-13 | 1.54130 | 7.57468 | 64.7295 | 4.557950e-06 | 0.120694 | 2.86273 | 2.75443 | -0.768744 | -97.5702 | 10.29 | 126.324000 | 32.643400 | -0.77 | -0.77 | 1 | 67561 | Methanol | Methanol | 67561 | 0.000000 | 20.0000 | 690.0 | 350.0 | 2700 | 680.0 | 260.0 | 1300.0 | NaN | 28.000 | NaN | NaN | NaN | |||
| 6 | Isopropyl_Alcohol | 0.00059 | NR | 0.000861 | Isopropyl Alcohol | Isopropyl Alcohol | Expert Validated Synonym | DTXSID7020762 | Isopropanol | DTXCID50762 | 67-63-0 | CC(C)O | C3H8O | 60.096 | 2.12814 | 83.075 | 0.013428 | 0.863 | 0.492 | 0.035892 | 6.163 | -45.893 | 0.001 | 0.053703 | 26.22 | 157.829 | 0.059156 | 2.023020 | 15.958800 | 4.786300 | 5.077690e-12 | 4.59819 | 7.53284 | 82.3951 | 8.088620e-06 | 0.079930 | 3.47701 | 3.43640 | 0.051948 | -89.6414 | 11.68 | 44.944600 | 9.005230 | 0.05 | 0.05 | 1 | 67630 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | |
| 7 | Total SVOCs | 0.017974 | 0.003953 | NaN | diethylene glycol | diethylene glycol | Approved Name | DTXSID8020462 | Diethylene glycol | DTXCID20462 | 111-46-6 | OCCOCCO | C4H10O3 | 106.121 | 0.656145 | 199.851 | 0.053951 | 1.076 | 0.215 | 0.119124 | 85.176 | -6.591 | 0.263 | 0.038282 | 37.899 | 191.896 | 0.119674 | 18.879900 | 0.007447 | 5.395110 | 2.990660e-11 | 3.43715 | 6.13275 | 245.6130 | 2.960770e-09 | 0.071864 | 7.13012 | 4.08583 | -1.093890 | -10.4231 | 7.06 | 0.005701 | 9.417610 | -2.66 | -1.25 | 1 | 111466 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | |
| 8 | Acetone | NaN | NaN | 0.002566 | Acetone | Acetone | Approved Name | DTXSID8021482 | Acetone | DTXCID101482 | 67-64-1 | CC(C)=O | C3H6O | 58.080 | 1.91426 | 41.374 | 0.021928 | 0.837 | 0.462 | 0.036308 | 9.637 | -63.606 | -0.029 | 0.062661 | 23.159 | 147.469 | 0.068391 | 0.319154 | 250.035000 | 5.623410 | 2.201470e-13 | 1.99247 | 7.56577 | 55.6196 | 3.532240e-05 | 0.160491 | 2.32758 | 3.65480 | -0.237520 | -96.2441 | 19.13 | 232.690000 | 17.063100 | -0.24 | -0.24 | 1 | 67641 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | |
| 9 | Propionaldehyde | NaN | NaN | 0.000004 | Propionaldehyde | Propionaldehyde | Expert Validated Synonym | DTXSID2021658 | Propanal | DTXCID001658 | 123-38-6 | CCC=O | C3H6O | 58.080 | 58.534 | 0.001959 | 0.843 | 0.629 | 0.000536 | 2.396 | -56.789 | 0.26 | 0.005875 | 22.728 | 149.586 | 0.003273 | 0.437522 | 221.820000 | 1.566750 | 1.961160e-11 | 5.49222 | 3.67945 | 48.0513 | 7.334760e-05 | 0.163907 | 2.90224 | 5.16901 | 0.589061 | -80.2497 | 314.891000 | 4.453230 | 0.59 | 0.59 | 1 | 123386 | Propionaldehyde | Propionaldehyde | 123386 | 0.000000 | 0.0080 | 110.0 | 110.0 | 620 | 260.0 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | |||
| 10 | 2-Butanone (MEK) | NaN | NaN | 0.008596 | 2-Butanone | 2-Butanone | Expert Validated Synonym | DTXSID3021516 | Methyl ethyl ketone | DTXCID801516 | 78-93-3 | CCC(C)=O | C4H8O | 72.107 | 2.66686 | 85.913 | 0.004624 | 0.877 | 0.481 | 0.010351 | 11.812 | -54.197 | 0.089 | 0.014723 | 24.679 | 144.036 | 0.022856 | 0.356451 | 106.170000 | 1.137630 | 1.153900e-12 | 4.09711 | 3.66957 | 79.3395 | 5.705120e-05 | 0.136632 | 2.72588 | 15.89840 | 0.291427 | -86.3934 | 90.624500 | 3.183170 | 0.29 | 0.29 | 1 | 78933 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ||
| 11 | 3-Pentanone | NaN | NaN | 1.295795 | 3-Pentanone | 3-Pentanone | Approved Name | DTXSID6021820 | 3-Pentanone | DTXCID301820 | 96-22-0 | CCC(=O)CC | C5H10O | 86.134 | 3.75837 | 104.735 | 0.001614 | 0.833 | 0.497 | 0.004775 | 19.233 | -59.074 | 0.198 | 0.016033 | 24.846 | 142.618 | 0.0139 | 0.432514 | 32.885200 | 0.381944 | 2.004050e-12 | 3.96080 | 5.24613 | 102.0200 | 5.053810e-05 | 0.179811 | 3.20144 | 19.53570 | 0.906191 | -42.0728 | 37.488700 | 0.546379 | 0.91 | 0.91 | 1 | 96220 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ||
| 12 | Benzaldehyde | NaN | NaN | 0.000003 | Benzaldehyde | Benzaldehyde | Approved Name | DTXSID8039241 | Benzaldehyde | DTXCID90134 | 100-52-7 | O=CC1=CC=CC=C1 | C7H6O | 106.124 | 6.16 | 185.010 | 0.000151 | 1.090 | 0.19 | 0.000158 | 73.440 | 6.480 | 0.04 | 0.012023 | 41.15 | 143.85 | 0.001288 | 1.412540 | 0.281838 | 0.035481 | 1.291460e-11 | 12.52050 | 5.92924 | 179.1020 | 2.673770e-05 | 0.202421 | 3.88581 | 32.50930 | 1.474340 | -25.5658 | 1.263430 | 0.062603 | 1.47 | 1.47 | 1 | 100527 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ||
| 13 | Ethanol | NaN | NaN | 1.181273 | Ethanol | Ethanol | Approved Name | DTXSID9020584 | Ethanol | DTXCID30584 | 64-17-5 | CCO | C2H6O | 46.069 | 1.25893 | 68.054 | 0.028249 | 0.912 | 0.455 | 0.017418 | 10.828 | -69.464 | -0.006 | 0.01714 | 24.095 | 182.077 | 0.103753 | 1.531090 | 31.550000 | 6.516280 | 3.277880e-12 | 1.81310 | 4.59705 | 78.2185 | 5.013510e-06 | 0.105204 | 3.24479 | 1.59008 | -0.309717 | -114.0380 | 12.31 | 58.854800 | 18.103000 | -0.31 | -0.31 | 1 | 64175 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | |
| 14 | Ethyl_Acetate | NaN | NaN | 0.018519 | Ethyl Acetate | Ethyl Acetate | Approved Name | DTXSID1022001 | Ethyl acetate | DTXCID602001 | 141-78-6 | CCOC(C)=O | C4H8O2 | 88.106 | 2.61216 | 81.196 | 0.002249 | 0.926 | 0.587 | 0.002004 | 14.040 | -70.237 | 0.141 | 0.06223 | 23.931 | 142.058 | 0.018197 | 0.465586 | 75.162300 | 0.475335 | 1.603440e-12 | 3.23156 | 4.12611 | 78.4376 | 1.348000e-04 | 0.180171 | 2.69862 | 18.17440 | 0.731494 | -83.9003 | 93.156800 | 0.911820 | 0.73 | 0.73 | 1 | 141786 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ||
| 15 | Toluene | NaN | NaN | 0.000013 | Toluene | Toluene | Expert Validated Synonym | DTXSID7021360 | 1-Methylbenzene | DTXCID501360 | 108-88-3 | CC1=CC=CC=C1 | C7H8 | 92.141 | 66.55 | 128.360 | 0.000229 | 0.900 | 0.28 | 0.000339 | 28.260 | -33.640 | -0.02 | 0.016982 | 29.18 | 132.42 | 0.001122 | 0.676083 | 23.988300 | 0.004074 | 5.973360e-12 | 8.33841 | 2.01480 | 110.6700 | 6.626450e-03 | 0.237095 | 3.49442 | 117.11500 | 2.728790 | -93.2830 | 28.316500 | 0.005918 | 2.73 | 2.73 | 1 | 108883 | Toluene | Toluene | 108883 | 0.000000 | 5.0000 | 250.0 | 250.0 | 2100 | 940.0 | 190.0 | 1100.0 | 7.500 | NaN | NaN | NaN | NaN | ||
| 16 | Alkane | NaN | NaN | 0.000327 | octane | octane | Approved Name | DTXSID0026882 | Octane | DTXCID406882 | 111-65-9 | CCCCCCCC | C8H18 | 114.232 | 580.764 | 130.843 | 0.00003 | 0.743 | 0.487 | 0.000016 | 24.976 | -71.701 | 0.039628 | 21.263 | 124.078 | 0.000105 | 0.500035 | 9.246980 | 0.000038 | 8.662630e-12 | 312.32300 | 8.98873 | 125.4960 | 3.655730e-01 | 4.112610 | 3.39317 | 191.49500 | 5.178630 | -57.4803 | 14.005100 | 0.000006 | 5.18 | 5.18 | 1 | 111659 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | |||
| 17 | PAH | NaN | NaN | 0.000649 | 1H-Indene-3-carboxylic acid | 1H-Indene-3-carboxylic acid | Approved Name | DTXSID20161940 | 1H-Indene-3-carboxylic acid | DTXCID5084431 | 14209-41-7 | OC(=O)C1=CCC2=CC=CC=C12 | C10H8O2 | 160.172 | 6.223 | 298.031 | 0.000202 | 1.261 | 0.606 | 0.000052 | 150.849 | 110.977 | 0.43 | 15.703600 | 0.000062 | 0.001832 | 3.070700e-11 | 4.01565 | 3.10224 | 302.6460 | 1.252300e-08 | 0.110657 | 8.38386 | 77.89030 | 2.150060 | 104.0450 | 5.29 | 0.000060 | 0.001932 | 1.73 | 0.04 | 1 | 14209417 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | |||||
| 18 | Glycol | NaN | NaN | 0.034017 | Glycol | Glycol | Synonym | DTXSID0021206 | 1,2-Propylene glycol | DTXCID901206 | 57-55-6 | CC(O)CO | C3H8O2 | 76.095 | 1.07647 | 168.555 | 0.026915 | 1.010 | 0.545 | 0.095061 | 70.374 | -21.625 | 0.196 | 0.053456 | 33.094 | 184.634 | 0.152055 | 12.618300 | 0.295121 | 4.315190 | 1.201600e-11 | 3.38004 | 4.26800 | 187.6690 | 6.054780e-08 | 0.059302 | 6.73741 | 2.30480 | -0.918877 | -59.8063 | 11.47 | 0.127532 | 13.154500 | -0.92 | -0.92 | 1 | 57556 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | |
| 19 | SubBenzene | NaN | NaN | 0.006565 | 1,2,3-trimethylbenzene | 1,2,3-trimethylbenzene | Approved Name | DTXSID8047769 | 1,2,3-Trimethylbenzene | DTXCID7027750 | 526-73-8 | CC1=CC=CC(C)=C1C | C9H12 | 120.195 | 173.38 | 172.792 | 0.000047 | 0.877 | 0.408 | 0.000111 | 48.824 | -17.530 | 0.043351 | 29.197 | 126.731 | 0.000335 | 1.119440 | 1.428890 | 0.001422 | 3.273340e-11 | 191.42700 | 4.01295 | 170.0170 | 4.442570e-03 | 0.604281 | 4.53535 | 631.60200 | 3.625410 | -38.3499 | 1.687560 | 0.000619 | 3.63 | 3.63 | 0 | 526738 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
dfmeasured['est_soa_yield'] = np.nan # SOA potential in g of SOA per g precursor
dfmeasured['est_mir'] = np.nan # O3 potential as MIR in g O3 per g precursor
dfmeasured['CRACMM1'] = np.nan # CRACMM version 1 species mapping (cite: Pye et al. 2023 ACP, https://doi.org/10.5194/acp-23-5043-2023)
dfmeasured['CRACMM2'] = np.nan # CRACMM version 2 species mapping (cite: Skipper et al. 2024 EGUSphere)
dfmeasured['log10Cstar_ugm3']=np.nan
for idx, row in dfmeasured.iterrows(): # Model predictions
smiles = row['SMILES']
pvap = row['VAPOR_PRESSURE_MMHG_OPERA_PRED']
molwght = row['AVERAGE_MASS']
dfmeasured.at[idx,'est_soa_yield'] = get_soayield(smiles,pvap,molwght)
koh = row['ATMOSPHERIC_HYDROXYLATION_RATE_(AOH)_CM3/MOLECULE*SEC_OPERA_PRED']
dfmeasured.at[idx,'est_mir'] = get_mir(smiles,koh)
log10cstar = np.log10( pvap * 101325.0/760 * molwght / RJmolK / Treference * 1e6 ) # log10Cstar where Cstar in micro-gram/m3
dfmeasured.at[idx,'log10Cstar_ugm3'] = log10cstar
dfmeasured.at[idx,'CRACMM2'] = cracmm2.get_cracmm_roc(smiles,koh,log10cstar)
dfmeasured.at[idx,'CRACMM1'] = cracmm1.get_cracmm_roc(smiles,koh,log10cstar)
dfmeasured[['species','representative','CRACMM2','CRACMM1','est_soa_yield','log10Cstar_ugm3']]
| species | representative | CRACMM2 | CRACMM1 | est_soa_yield | log10Cstar_ugm3 | |
|---|---|---|---|---|---|---|
| 0 | Formaldehyde | Formaldehyde | HCHO | HCHO | 0.000000 | 9.124599 |
| 1 | Acetaldehyde | Acetaldehyde | ACD | ACD | 0.000000 | 9.328035 |
| 2 | Unknown as Acetone | acetone | ACT | ACT | 0.000000 | 8.861463 |
| 3 | Butanal | Butanal | ALD | ALD | 0.000000 | 8.634506 |
| 4 | Hexaldehyde | Hexaldehyde | ALD | ALD | 0.016002 | 7.786582 |
| 5 | Methanol | Methanol | MOH | MOH | 0.000000 | 8.337864 |
| 6 | Isopropyl_Alcohol | Isopropyl Alcohol | ROH | ROH | 0.000000 | 8.162181 |
| 7 | Total SVOCs | diethylene glycol | VROCIOXY | VROCIOXY | 0.000000 | 4.512393 |
| 8 | Acetone | Acetone | ACT | ACT | 0.000000 | 8.861463 |
| 9 | Propionaldehyde | Propionaldehyde | ALD | ALD | 0.000000 | 8.992845 |
| 10 | 2-Butanone (MEK) | 2-Butanone | MEK | MEK | 0.000000 | 8.545881 |
| 11 | 3-Pentanone | 3-Pentanone | KET | KET | 0.021689 | 8.239733 |
| 12 | Benzaldehyde | Benzaldehyde | BALD | BALD | 0.021413 | 6.858023 |
| 13 | Ethanol | Ethanol | EOH | EOH | 0.000000 | 8.163849 |
| 14 | Ethyl_Acetate | Ethyl Acetate | HC3 | HC3 | 0.000000 | 8.644878 |
| 15 | Toluene | Toluene | TOL | TOL | 0.332008 | 8.147151 |
| 16 | Alkane | octane | HC10 | HC10 | 0.015400 | 7.934732 |
| 17 | PAH | 1H-Indene-3-carboxylic acid | VROCP5ARO | ROCP5ARO | 0.324822 | 2.716479 |
| 18 | Glycol | Glycol | PROG | PROG | 0.000000 | 5.717633 |
| 19 | SubBenzene | 1,2,3-trimethylbenzene | XYL | XYM | 0.067903 | 7.037804 |
filename = outputdir + '/' + str(today) + '_SuppTable_SpeciesProps.csv'
dfmeasured.to_csv(filename, index=False)
# Print results (lowest to highest yield)--SOA yields are SOA in g per g of that species emitted
dfmeasured[['species','representative','CRACMM2','est_soa_yield']].sort_values(by='est_soa_yield')
| species | representative | CRACMM2 | est_soa_yield | |
|---|---|---|---|---|
| 0 | Formaldehyde | Formaldehyde | HCHO | 0.000000 |
| 14 | Ethyl_Acetate | Ethyl Acetate | HC3 | 0.000000 |
| 13 | Ethanol | Ethanol | EOH | 0.000000 |
| 10 | 2-Butanone (MEK) | 2-Butanone | MEK | 0.000000 |
| 18 | Glycol | Glycol | PROG | 0.000000 |
| 8 | Acetone | Acetone | ACT | 0.000000 |
| 7 | Total SVOCs | diethylene glycol | VROCIOXY | 0.000000 |
| 9 | Propionaldehyde | Propionaldehyde | ALD | 0.000000 |
| 5 | Methanol | Methanol | MOH | 0.000000 |
| 3 | Butanal | Butanal | ALD | 0.000000 |
| 2 | Unknown as Acetone | acetone | ACT | 0.000000 |
| 1 | Acetaldehyde | Acetaldehyde | ACD | 0.000000 |
| 6 | Isopropyl_Alcohol | Isopropyl Alcohol | ROH | 0.000000 |
| 16 | Alkane | octane | HC10 | 0.015400 |
| 4 | Hexaldehyde | Hexaldehyde | ALD | 0.016002 |
| 12 | Benzaldehyde | Benzaldehyde | BALD | 0.021413 |
| 11 | 3-Pentanone | 3-Pentanone | KET | 0.021689 |
| 19 | SubBenzene | 1,2,3-trimethylbenzene | XYL | 0.067903 |
| 17 | PAH | 1H-Indene-3-carboxylic acid | VROCP5ARO | 0.324822 |
| 15 | Toluene | Toluene | TOL | 0.332008 |
# print results (lowest to highest MIR)--MIR values are O3 formation in g per g of that species emitted
dfmeasured[['species','representative','CRACMM2','est_mir']].sort_values(by='est_mir')
| species | representative | CRACMM2 | est_mir | |
|---|---|---|---|---|
| 16 | Alkane | octane | HC10 | 1.216821 |
| 8 | Acetone | Acetone | ACT | 1.537857 |
| 2 | Unknown as Acetone | acetone | ACT | 1.537857 |
| 11 | 3-Pentanone | 3-Pentanone | KET | 1.703805 |
| 12 | Benzaldehyde | Benzaldehyde | BALD | 1.720558 |
| 10 | 2-Butanone (MEK) | 2-Butanone | MEK | 1.902075 |
| 14 | Ethyl_Acetate | Ethyl Acetate | HC3 | 1.903262 |
| 6 | Isopropyl_Alcohol | Isopropyl Alcohol | ROH | 2.618392 |
| 13 | Ethanol | Ethanol | EOH | 3.235079 |
| 17 | PAH | 1H-Indene-3-carboxylic acid | VROCP5ARO | 3.542421 |
| 18 | Glycol | Glycol | PROG | 3.609181 |
| 5 | Methanol | Methanol | MOH | 3.692454 |
| 15 | Toluene | Toluene | TOL | 4.004700 |
| 7 | Total SVOCs | diethylene glycol | VROCIOXY | 4.107045 |
| 4 | Hexaldehyde | Hexaldehyde | ALD | 5.358271 |
| 3 | Butanal | Butanal | ALD | 6.145126 |
| 9 | Propionaldehyde | Propionaldehyde | ALD | 6.704816 |
| 1 | Acetaldehyde | Acetaldehyde | ACD | 7.484428 |
| 0 | Formaldehyde | Formaldehyde | HCHO | 8.355971 |
| 19 | SubBenzene | 1,2,3-trimethylbenzene | XYL | 10.463000 |
# Total emission and SDS sheet info
dftotemiss23 = pd.read_excel( measfilename, sheet_name = 'Data Analysis', skiprows = 15, nrows = 5, header=None, usecols= 'B,D,E')
dftotemiss23.rename(columns={1:'variable'},inplace=True)
dftotemiss23.rename(columns={3:'T2'},inplace=True)
dftotemiss23.rename(columns={4:'T3'},inplace=True)
dftotemiss4 = pd.read_excel( measfilename, sheet_name = 'Data Analysis', skiprows = 26, nrows = 5, header=None, usecols= 'G,J')
dftotemiss4.rename(columns={9:'T4'},inplace=True)
dftotemiss4.rename(columns={6:'variable'},inplace=True)
dftotemiss = pd.merge(dftotemiss23,dftotemiss4,on='variable',how='outer') # slight renameing of variable
dftotemiss
| variable | T2 | T3 | T4 | |
|---|---|---|---|---|
| 0 | Total mass measured, g (VOC data) | NaN | 0.013576 | 2.553791 |
| 1 | Total mass measured, g (HPLC data) | 0.055908 | 0.013128 | 1.264008 |
| 2 | Ink mass lost during test, g | 4.078460 | 4.538230 | 3.212960 |
| 3 | 10% Emittable mass bsed on SDS, g | 0.407846 | 0.453823 | NaN |
| 4 | % Measured/emittable | 13.708183 | 2.991548 | 79.484047 |
| 5 | Emittable mass bsed on SDS, g | NaN | NaN | 3.212960 |
dftotused = pd.read_excel( measfilename, sheet_name = 'Data Analysis', skiprows = 36, nrows = 1, header=None, usecols= 'B,D,F,I')
dftotused.rename(columns={1:'variable'},inplace=True)
dftotused.rename(columns={3:'T2'},inplace=True)
dftotused.rename(columns={5:'T3'},inplace=True)
dftotused.rename(columns={8:'T4'},inplace=True)
dftotemiss = pd.concat([dftotemiss,dftotused],axis=0) # slight renaming of variable
dftotemiss.set_index('variable',inplace=True)
dftotemiss
| T2 | T3 | T4 | |
|---|---|---|---|
| variable | |||
| Total mass measured, g (VOC data) | NaN | 0.013576 | 2.553791 |
| Total mass measured, g (HPLC data) | 0.055908 | 0.013128 | 1.264008 |
| Ink mass lost during test, g | 4.078460 | 4.538230 | 3.212960 |
| 10% Emittable mass bsed on SDS, g | 0.407846 | 0.453823 | NaN |
| % Measured/emittable | 13.708183 | 2.991548 | 79.484047 |
| Emittable mass bsed on SDS, g | NaN | NaN | 3.212960 |
| Ink mass for testing, g | 5.349070 | 6.177660 | 4.064830 |
# T2 (water-based): composition, SOA, O3
fig, axes = plt.subplots(nrows=1, ncols=3, figsize=[12,5])
plotdata = dfmeasured[['species','T2_emiss_g','est_soa_yield','est_mir']].copy()
plotdata.replace('ND',np.nan,inplace=True)
plotdata.replace('NR',np.nan,inplace=True)
plotdata['SOA_mg']=plotdata['T2_emiss_g']*plotdata['est_soa_yield']*1000
plotdata['O3_g']=plotdata['T2_emiss_g']*plotdata['est_mir']
plotdata.set_index(plotdata['species'],inplace=True)
plotdata=plotdata.drop(columns=['est_soa_yield','est_mir','species'])
#plotdata.dropna(inplace=True)
print(plotdata)
# effective yields
t2ysoaperemiss = plotdata['SOA_mg'].sum()/1000.0/plotdata['T2_emiss_g'].sum()
t2yo3peremiss = plotdata['O3_g'].sum()/plotdata['T2_emiss_g'].sum()
print('-->Potential SOA mass per ink mass emitted (g/g ROC): '+str(round(t2ysoaperemiss,6)))
print('-->Potential O3 mass per ink mass emitted (g/g ROC): '+str(round(t2yo3peremiss,6)))
# absolute value panel
Tplotdata=plotdata.T # transpose
Tplotdata.plot.bar( ax=axes[0], stacked=True, ylabel='mass in grams', title='T2 emiss, SOA, and O3 (mass)', colormap='tab20')
# relative value panel
plotdata['T2_emiss_g']=plotdata['T2_emiss_g']/plotdata['T2_emiss_g'].sum()
plotdata['SOA_mg']=plotdata['SOA_mg']/plotdata['SOA_mg'].sum()
plotdata['O3_g']=plotdata['O3_g']/plotdata['O3_g'].sum()
Tplotdata=plotdata.T
Tplotdata.plot.bar( ax=axes[1], stacked=True, ylabel='fraction by mass', title='T2 emiss, SOA, and O3 (fraction)',colormap='tab20')
# legend for all
axes[0].get_legend().remove()
axes[1].get_legend().remove()
handles, labels = axes[0].get_legend_handles_labels()
axes[2].legend(handles[::-1], labels[::-1], loc='upper center') # reverse order of labels so they match stacking
T2_emiss_g SOA_mg O3_g species Formaldehyde 0.000017 0.000000 0.000144 Acetaldehyde 0.000062 0.000000 0.000463 Unknown as Acetone 0.000921 0.000000 0.001416 Butanal NaN NaN NaN Hexaldehyde 0.000015 0.000233 0.000078 Methanol 0.036330 0.000000 0.134148 Isopropyl_Alcohol 0.000590 0.000000 0.001544 Total SVOCs 0.017974 0.000000 0.073820 Acetone NaN NaN NaN Propionaldehyde NaN NaN NaN 2-Butanone (MEK) NaN NaN NaN 3-Pentanone NaN NaN NaN Benzaldehyde NaN NaN NaN Ethanol NaN NaN NaN Ethyl_Acetate NaN NaN NaN Toluene NaN NaN NaN Alkane NaN NaN NaN PAH NaN NaN NaN Glycol NaN NaN NaN SubBenzene NaN NaN NaN -->Potential SOA mass per ink mass emitted (g/g ROC): 4e-06 -->Potential O3 mass per ink mass emitted (g/g ROC): 3.784998
<matplotlib.legend.Legend at 0x14c66c59b9d0>
# T3 (water-based): composition, SOA, O3
fig, axes = plt.subplots(nrows=1, ncols=3, figsize=[12,5])
plotdata = dfmeasured[['species','T3_emiss_g','est_soa_yield','est_mir']].copy()
plotdata.replace('NR',np.nan,inplace=True)
plotdata.replace('ND',np.nan,inplace=True)
plotdata['SOA_mg']=plotdata['T3_emiss_g']*plotdata['est_soa_yield']*1000
plotdata['O3_g']=plotdata['T3_emiss_g']*plotdata['est_mir']
plotdata.set_index(plotdata['species'],inplace=True)
plotdata=plotdata.drop(columns=['est_soa_yield','est_mir','species'])
#plotdata.dropna(inplace=True)
print(plotdata)
# effective yields
t3ysoaperemiss = plotdata['SOA_mg'].sum()/1000.0/plotdata['T3_emiss_g'].sum()
t3yo3peremiss = plotdata['O3_g'].sum()/plotdata['T3_emiss_g'].sum()
print('-->Potential SOA mass per ink mass emitted (g/g ROC): '+str(round(t3ysoaperemiss,6)))
print('-->Potential O3 mass per ink mass emitted (g/g ROC): '+str(round(t3yo3peremiss,6)))
# abs value panel
Tplotdata=plotdata.T
Tplotdata.plot.bar( ax=axes[0], stacked=True, ylabel='grams', title='T3 emiss, SOA, and O3 (mass)', colormap='tab20')
# relative value panel
plotdata['T3_emiss_g']=plotdata['T3_emiss_g']/plotdata['T3_emiss_g'].sum()
plotdata['SOA_mg']=plotdata['SOA_mg']/plotdata['SOA_mg'].sum()
plotdata['O3_g']=plotdata['O3_g']/plotdata['O3_g'].sum()
Tplotdata=plotdata.T
Tplotdata.plot.bar( ax=axes[1], stacked=True, ylabel='fraction by mass', title='T3 emiss, SOA, and O3 (fraction)',colormap='tab20')
# legend for all
axes[0].get_legend().remove()
axes[1].get_legend().remove()
handles, labels = axes[0].get_legend_handles_labels()
axes[2].legend(handles[::-1], labels[::-1], loc='upper center') # reverse order of labels so they match stacking
T3_emiss_g SOA_mg O3_g species Formaldehyde 0.000019 0.000000 0.000156 Acetaldehyde 0.000552 0.000000 0.004132 Unknown as Acetone 0.001060 0.000000 0.001631 Butanal 0.000005 0.000000 0.000029 Hexaldehyde 0.000018 0.000289 0.000097 Methanol 0.007970 0.000000 0.029427 Isopropyl_Alcohol NaN NaN NaN Total SVOCs 0.003953 0.000000 0.016234 Acetone NaN NaN NaN Propionaldehyde NaN NaN NaN 2-Butanone (MEK) NaN NaN NaN 3-Pentanone NaN NaN NaN Benzaldehyde NaN NaN NaN Ethanol NaN NaN NaN Ethyl_Acetate NaN NaN NaN Toluene NaN NaN NaN Alkane NaN NaN NaN PAH NaN NaN NaN Glycol NaN NaN NaN SubBenzene NaN NaN NaN -->Potential SOA mass per ink mass emitted (g/g ROC): 2.1e-05 -->Potential O3 mass per ink mass emitted (g/g ROC): 3.808533
<matplotlib.legend.Legend at 0x14c66715ba90>
# T4 (organic): composition, SOA, O3
fig, axes = plt.subplots(nrows=1, ncols=3, figsize=[12,5])
plotdata = dfmeasured[['species','T4_emiss_g','est_soa_yield','est_mir']].copy()
plotdata.replace('NR',np.nan,inplace=True)
plotdata.replace('ND',np.nan,inplace=True)
plotdata['SOA_mg']=plotdata['T4_emiss_g']*plotdata['est_soa_yield']*1000
plotdata['O3_g']=plotdata['T4_emiss_g']*plotdata['est_mir']
plotdata.set_index(plotdata['species'],inplace=True)
plotdata=plotdata.drop(columns=['est_soa_yield','est_mir','species'])
#plotdata.dropna(inplace=True)
print(plotdata)
# effective yields
t4ysoaperemiss = plotdata['SOA_mg'].sum()/1000.0/plotdata['T4_emiss_g'].sum()
t4yo3peremiss = plotdata['O3_g'].sum()/plotdata['T4_emiss_g'].sum()
print('-->Potential SOA mass per ink mass emitted (g/g ROC): '+str(round(t4ysoaperemiss,6)))
print('-->Potential O3 mass per ink mass emitted (g/g ROC): '+str(round(t4yo3peremiss,6)))
# absolute values
Tplotdata=plotdata.T
Tplotdata.plot.bar( ax=axes[0], stacked=True, ylabel='grams', title='T4 emiss, SOA, and O3 (mass)',colormap='tab20')
#plt.legend(loc='upper left')
# relative value panel
plotdata['T4_emiss_g']=plotdata['T4_emiss_g']/plotdata['T4_emiss_g'].sum()
plotdata['SOA_mg']=plotdata['SOA_mg']/plotdata['SOA_mg'].sum()
plotdata['O3_g']=plotdata['O3_g']/plotdata['O3_g'].sum()
Tplotdata=plotdata.T
Tplotdata.plot.bar( ax=axes[1], stacked=True, ylabel='fraction by mass', title='T4 emiss, SOA, and O3 (fraction)',colormap='tab20')
# legend for all
axes[0].get_legend().remove()
axes[1].get_legend().remove()
handles, labels = axes[0].get_legend_handles_labels()
axes[2].legend(handles[::-1], labels[::-1], loc='upper center') # reverse order of labels so they match stacking
T4_emiss_g SOA_mg O3_g species Formaldehyde NaN NaN NaN Acetaldehyde 0.000672 0.000000 0.005026 Unknown as Acetone NaN NaN NaN Butanal NaN NaN NaN Hexaldehyde NaN NaN NaN Methanol 0.003933 0.000000 0.014522 Isopropyl_Alcohol 0.000861 0.000000 0.002253 Total SVOCs NaN NaN NaN Acetone 0.002566 0.000000 0.003945 Propionaldehyde 0.000004 0.000000 0.000028 2-Butanone (MEK) 0.008596 0.000000 0.016351 3-Pentanone 1.295795 28.103985 2.207782 Benzaldehyde 0.000003 0.000054 0.000004 Ethanol 1.181273 0.000000 3.821511 Ethyl_Acetate 0.018519 0.000000 0.035247 Toluene 0.000013 0.004175 0.000050 Alkane 0.000327 0.005043 0.000398 PAH 0.000649 0.210695 0.002298 Glycol 0.034017 0.000000 0.122772 SubBenzene 0.006565 0.445763 0.068686 -->Potential SOA mass per ink mass emitted (g/g ROC): 0.011265 -->Potential O3 mass per ink mass emitted (g/g ROC): 2.467264
<matplotlib.legend.Legend at 0x14c66c0383a0>
# Add data from previous SPECIATE profiles
# From Karl: The 2570 profile is the one used in the original VCPY work, including the ES&T paper.
# The second profile, 95827, is also quite old but from CARB and the current operational profile.
# As you can see in the calculations, the estimated SOA yield of 95827 is about 1/3 smaller than 2570 and the estimated MIR of the two are about the same.
filename = inputdir + 'printing_ink_profiles_seltzer.xlsx'
dfspeciate = pd.read_excel( filename )
# yields per g emitted
profile2570soayield = np.sum(dfspeciate[dfspeciate.PROFILE_CODE == 2570].est_soa_yield * dfspeciate[dfspeciate.PROFILE_CODE == 2570].WEIGHT_PERCENT/100 )#g # = dfspeciate.rename(columns={'Unnamed: 3':'species'})
profile2570o3yield = np.sum(dfspeciate[dfspeciate.PROFILE_CODE == 2570].est_mir * dfspeciate[dfspeciate.PROFILE_CODE == 2570].WEIGHT_PERCENT/100 )
profile95837soayield = np.sum(dfspeciate[dfspeciate.PROFILE_CODE == 95837].est_soa_yield * dfspeciate[dfspeciate.PROFILE_CODE == 95837].WEIGHT_PERCENT/100 )
profile95837o3yield = np.sum(dfspeciate[dfspeciate.PROFILE_CODE == 95837].est_mir * dfspeciate[dfspeciate.PROFILE_CODE == 95837].WEIGHT_PERCENT/100 )
print('SOA yields g/g:')
print(profile2570soayield,profile2570o3yield,profile95837soayield,profile95837o3yield)
SOA yields g/g: 0.19688604033964424 2.1759332857585454 0.06363066799073001 2.2901000977542845
fig, axes = plt.subplots(nrows=4, ncols=1, figsize=[2.5,6], height_ratios=[6,8.5,12.5,2],gridspec_kw=dict(
wspace=0.0, hspace=0.8, left=0.13,right=0.95,top=0.95,bottom=0.15), dpi=300)
cmap = plt.colormaps['tab10']
# colors
Acol = 'tab:orange'
Bcol = 'tab:blue'
Ccol = 'tab:green'
col1989 = 'tab:brown'
colCARB = 'tab:grey'
vcpycol = 'tab:olive'
ft2=dfmeasured.replace('ND',np.nan).replace('NR',np.nan).sum(numeric_only=True)['T2_emiss_g']/dftotemiss.loc['Ink mass for testing, g']['T2']
ft3=dfmeasured.replace('ND',np.nan).replace('NR',np.nan).sum(numeric_only=True)['T3_emiss_g']/dftotemiss.loc['Ink mass for testing, g']['T3']
ft4=dfmeasured.replace('ND',np.nan).replace('NR',np.nan).sum(numeric_only=True)['T4_emiss_g']/dftotemiss.loc['Ink mass for testing, g']['T4']
ax = axes[0]
# Mass emitted per mass used
data = { 'ROC': [0.2498,ft3,ft2,ft4] } #0.248 from Karl
#df = pd.DataFrame(data,index=['T2','T3','T4']).T
df = pd.DataFrame(data,index=['VCPy','C','B','A',]).T
color = [vcpycol,Ccol,Bcol,Acol]
df.plot.barh( ax=ax, stacked=False, ylabel=' ', width = 0.9, color=color,fontsize=8,log=True,linewidth=0.5,edgecolor='black')
ax.set_xlabel('g/g of ink',fontsize=8,labelpad=1)
ax.set_title('(a) Emissions per product mass',fontsize=8)
ax.xaxis.set_tick_params(which='major',labelsize=7,pad=1,length=2.5)
ax.xaxis.set_tick_params(which='minor',labelsize=7,pad=1,length=1.5)
ax.set_xlim(0.001,1)
ax.yaxis.set_tick_params(labelsize=7,pad=2,length=0)
# print to screen
print('----Emissions per mass used (g/g ink)')
print(df)
dfa = df.copy()
ax.get_legend().remove()
ax = axes[1]
# SOA and O3 per usage
data = { 'SOA': [t3ysoaperemiss*ft3,t2ysoaperemiss*ft2,t4ysoaperemiss*ft4],
'O$_3$' : [t3yo3peremiss*ft3,t2yo3peremiss*ft2,t4yo3peremiss*ft4]}
#df = pd.DataFrame(data,index=['T2','T3','T4']).T
df = pd.DataFrame(data,index=['C','B','A']).T
color = [Ccol,Bcol,Acol]
df.plot.barh( ax=ax, stacked=False, ylabel=' ', width = 0.9, color=color,fontsize=8,log=True,linewidth=0.5,edgecolor='black')
ax.set_xlabel('g/g of ink',fontsize=8)
ax.set_title('(b) Potential per product mass',fontsize=8)
maj_loc = ticker.LogLocator(numticks=5)
ax.xaxis.set_major_locator(maj_loc)
ax.xaxis.set_tick_params(which='major',labelsize=7,pad=1,length=2.5)
ax.xaxis.set_tick_params(which='minor',labelsize=7,pad=1,length=1.5)
ax.yaxis.set_tick_params(labelsize=7,pad=2,length=0)
ax.set_xlim(1e-8,10)
# print to screen
print('----SOA or O3 potential per mass used (g/g ink)')
print(df)
dfb = df.copy()
ax.get_legend().remove()
ax = axes[2]
# SOA and O3 per emission
data = { 'SOA': [profile2570soayield,profile95837soayield,t3ysoaperemiss,t2ysoaperemiss,t4ysoaperemiss],
'O$_3$' : [profile2570o3yield,profile95837o3yield,t3yo3peremiss,t2yo3peremiss,t4yo3peremiss]}
#df = pd.DataFrame(data,index=['T2','T3','T4']).T
df = pd.DataFrame(data,index=['1989 Ink','CARB Ink','C','B','A',]).T
color = [col1989,colCARB,Ccol,Bcol,Acol]
df.plot.barh( ax=ax, stacked=False, width = 0.9, color=color,fontsize=8,log=True,linewidth=0.5,edgecolor='black')
ax.set_xlabel('g/g ROC emitted',fontsize=8,labelpad=1)
handles, labels = ax.get_legend_handles_labels()
ax.set_title('(c) Potential per mass emitted',fontsize=8)
ax.xaxis.set_tick_params(which='major',labelsize=6,pad=1,length=2.5)
ax.xaxis.set_tick_params(which='minor',labelsize=7,pad=1,length=1.5)
ax.yaxis.set_tick_params(labelsize=7,pad=2,length=0)
ax.set_xlim(1e-6,10)
ax.get_legend().remove()
# print to screen
print('----SOA or O3 per speciated mass emitted (g/g ROC emitted)')
print(df)
dfc = df.copy()
# legend only
ax = axes[3]
apatch = mpatches.Patch( facecolor = Acol, linewidth=0.5,edgecolor='black', label='A')
bpatch = mpatches.Patch ( facecolor = Bcol, linewidth=0.5,edgecolor='black', label='B')
cpatch = mpatches.Patch (facecolor = Ccol , linewidth=0.5,edgecolor='black',label = 'C')
patch1989 = mpatches.Patch (facecolor = col1989, linewidth=0.5,edgecolor='black',label = '1989')
patchCARB = mpatches.Patch( facecolor= colCARB, linewidth=0.5,edgecolor='black',label = 'CARB')
vcpypatch = mpatches.Patch( facecolor = vcpycol, linewidth=0.5,edgecolor='black',label = 'VCPy')
ax.legend(handles=[apatch,bpatch,cpatch,vcpypatch,patch1989,patchCARB],loc='center',bbox_to_anchor=(0.45,-1),
fontsize=8,labelspacing=0.22, title='Ink Types' )#
ax.axis("off")
fig.savefig(outputdir + '/'+str(today)+'_Figure3_massyield.png', facecolor='w', transparent=False)
----Emissions per mass used (g/g ink)
VCPy C B A
ROC 0.2498 0.002198 0.010452 0.628265
----SOA or O3 potential per mass used (g/g ink)
C B A
SOA 4.672043e-08 4.347300e-08 0.007078
O$_3$ 8.369820e-03 3.956065e-02 1.550096
----SOA or O3 per speciated mass emitted (g/g ROC emitted)
1989 Ink CARB Ink C B A
SOA 0.196886 0.063631 0.000021 0.000004 0.011265
O$_3$ 2.175933 2.290100 3.808533 3.784998 2.467264
# Fraction of ink place in test that is emitted and identified by a species
dfmeasured.replace('ND',np.nan).replace('NR',np.nan).sum(numeric_only=True)['T2_emiss_g']/dftotemiss.loc['Ink mass for testing, g']['T2']
0.010451961908468676
dfmeasured.replace('ND',np.nan).replace('NR',np.nan).sum(numeric_only=True)['T3_emiss_g']/dftotemiss.loc['Ink mass for testing, g']['T3']
0.0021976496105312548
dfmeasured.replace('ND',np.nan).replace('NR',np.nan).sum(numeric_only=True)['T4_emiss_g']/dftotemiss.loc['Ink mass for testing, g']['T4']
0.6282650525191288
# Total emission and SDS sheet info
filename = inputdir + 'inksales.xlsx'
dftrends = pd.read_excel( filename )
dftrends.set_index('Unnamed: 0',inplace=True)
dftrends=dftrends.T
dftrends.index.rename('year',inplace=True)
dftrends
| Unnamed: 0 | Printing Ink Usage [kg/person/yr] | Population | Printing Ink Usage [Gg/yr] |
|---|---|---|---|
| year | |||
| 2002 | 4.33 | 287625193.0 | 1246.13 |
| 2003 | 4.13 | 290107933.0 | 1199.54 |
| 2004 | 4.76 | 292805298.0 | 1392.59 |
| 2005 | 4.69 | 295516599.0 | 1385.92 |
| 2006 | 4.27 | 298379912.0 | 1275.45 |
| 2007 | 4.23 | 301231207.0 | 1275.02 |
| 2008 | 3.66 | 304093966.0 | 1113.38 |
| 2009 | 3.09 | 306771529.0 | 948.26 |
| 2010 | 3.58 | 309321666.0 | 1107.28 |
| 2011 | 3.58 | 311556874.0 | 1116.93 |
| 2012 | 3.41 | 313830990.0 | 1071.50 |
| 2013 | 3.56 | 315993715.0 | 1124.80 |
| 2014 | 3.26 | 318301008.0 | 1036.63 |
| 2015 | 3.12 | 320635163.0 | 999.19 |
| 2016 | 2.87 | 322941311.0 | 925.76 |
| 2017 | 2.66 | 324985539.0 | 864.06 |
| 2018 | 2.81 | 326687501.0 | 919.17 |
| 2019 | 2.58 | 328239523.0 | 846.14 |
| 2020 | 2.38 | 331511512.0 | 789.52 |
| 2021 | 2.27 | 332031554.0 | 752.65 |
# SOA and O3 potential (mass in Gg)
### IF DATA IS UPDATED, DOUBLE CHECK THIS--VALUES ARE FROM PREVIOUS PLOT
# Figure 3b, ink A--calculate SOA and O3 if all ink was A
SOAyieldpermassusedA = 7.078/1000 #g/kg
O3yieldpermassusedA = 1.55
dftrends['soaforallA'] = dftrends['Printing Ink Usage [Gg/yr]']*SOAyieldpermassusedA #Gg*mg/g *1g/1000mg
dftrends['o3forallA'] = dftrends['Printing Ink Usage [Gg/yr]']*O3yieldpermassusedA
# Figure 3b, ink B--calculate SOA and O3 if all ink was B
SOAyieldpermassusedB = 4.3e-8 #g/kg
O3yieldpermassusedB = 3.96e-2
dftrends['soaforallB'] = dftrends['Printing Ink Usage [Gg/yr]']*SOAyieldpermassusedB
dftrends['o3forallB'] =dftrends['Printing Ink Usage [Gg/yr]']*O3yieldpermassusedB
# Emission factors g/g from Figure 3a
ROCEFA = 0.628265
ROCEFB = 0.010452
dftrends
| Unnamed: 0 | Printing Ink Usage [kg/person/yr] | Population | Printing Ink Usage [Gg/yr] | soaforallA | o3forallA | soaforallB | o3forallB |
|---|---|---|---|---|---|---|---|
| year | |||||||
| 2002 | 4.33 | 287625193.0 | 1246.13 | 8.820108 | 1931.5015 | 0.000054 | 49.346748 |
| 2003 | 4.13 | 290107933.0 | 1199.54 | 8.490344 | 1859.2870 | 0.000052 | 47.501784 |
| 2004 | 4.76 | 292805298.0 | 1392.59 | 9.856752 | 2158.5145 | 0.000060 | 55.146564 |
| 2005 | 4.69 | 295516599.0 | 1385.92 | 9.809542 | 2148.1760 | 0.000060 | 54.882432 |
| 2006 | 4.27 | 298379912.0 | 1275.45 | 9.027635 | 1976.9475 | 0.000055 | 50.507820 |
| 2007 | 4.23 | 301231207.0 | 1275.02 | 9.024592 | 1976.2810 | 0.000055 | 50.490792 |
| 2008 | 3.66 | 304093966.0 | 1113.38 | 7.880504 | 1725.7390 | 0.000048 | 44.089848 |
| 2009 | 3.09 | 306771529.0 | 948.26 | 6.711784 | 1469.8030 | 0.000041 | 37.551096 |
| 2010 | 3.58 | 309321666.0 | 1107.28 | 7.837328 | 1716.2840 | 0.000048 | 43.848288 |
| 2011 | 3.58 | 311556874.0 | 1116.93 | 7.905631 | 1731.2415 | 0.000048 | 44.230428 |
| 2012 | 3.41 | 313830990.0 | 1071.50 | 7.584077 | 1660.8250 | 0.000046 | 42.431400 |
| 2013 | 3.56 | 315993715.0 | 1124.80 | 7.961334 | 1743.4400 | 0.000048 | 44.542080 |
| 2014 | 3.26 | 318301008.0 | 1036.63 | 7.337267 | 1606.7765 | 0.000045 | 41.050548 |
| 2015 | 3.12 | 320635163.0 | 999.19 | 7.072267 | 1548.7445 | 0.000043 | 39.567924 |
| 2016 | 2.87 | 322941311.0 | 925.76 | 6.552529 | 1434.9280 | 0.000040 | 36.660096 |
| 2017 | 2.66 | 324985539.0 | 864.06 | 6.115817 | 1339.2930 | 0.000037 | 34.216776 |
| 2018 | 2.81 | 326687501.0 | 919.17 | 6.505885 | 1424.7135 | 0.000040 | 36.399132 |
| 2019 | 2.58 | 328239523.0 | 846.14 | 5.988979 | 1311.5170 | 0.000036 | 33.507144 |
| 2020 | 2.38 | 331511512.0 | 789.52 | 5.588223 | 1223.7560 | 0.000034 | 31.264992 |
| 2021 | 2.27 | 332031554.0 | 752.65 | 5.327257 | 1166.6075 | 0.000032 | 29.804940 |
#dftrends['soaforallA']/dftrends['soaforallB']
#dftrends['o3forallA']/dftrends['o3forallB']
# Calculate water-based ink usage by year
#waterfrac = 0.187 * (0.031 + 1 )**(dftrends.index-2022) # cagr formula
# data was for 2022, assume 2021 and 2022 same total sales and 18.7% was 2022 year data (thus 2021 is a bit lower)
finalusage = 0.187 * dftrends[dftrends.index==2021]['Printing Ink Usage [Gg/yr]'].loc[2021]
print(finalusage)
waterusagebyyear= finalusage / (0.031 + 1 )**(2022-dftrends.index)
waterusagebyyear
140.74555
Float64Index([ 76.42956131046317, 78.79887771108753, 81.24164292013123,
83.7601338506553, 86.3566980000256, 89.03375563802638,
91.7938020628052, 94.63940992675215, 97.57323163448146,
100.59800181515037, 103.71653987142003, 106.93175260743405,
110.24663693826449, 113.66428268335069, 117.18787544653455,
120.82069958537711, 124.56614127252377, 128.427691651972,
132.40895009318314, 136.5136275460718],
dtype='float64', name='year')
(259.18/140.74)**(1/20)-1 # check this is 3.1%, this is initial to final year
0.03100126213924015
dftrends['SOAyieldforscenario [g/g ink]']= ( waterusagebyyear * SOAyieldpermassusedB + ( dftrends['Printing Ink Usage [Gg/yr]'] - waterusagebyyear ) * SOAyieldpermassusedA )/ dftrends['Printing Ink Usage [Gg/yr]']
dftrends['O3yieldforscenario [g/g ink]']= ( waterusagebyyear * O3yieldpermassusedB + ( dftrends['Printing Ink Usage [Gg/yr]'] - waterusagebyyear ) * O3yieldpermassusedA )/ dftrends['Printing Ink Usage [Gg/yr]']
dftrends['ROC Emissions [Gg/yr]']= ( waterusagebyyear * ROCEFB + ( dftrends['Printing Ink Usage [Gg/yr]'] - waterusagebyyear ) * ROCEFA )
dftrends['Water-based Ink Usage [Gg/yr]']= ( waterusagebyyear )
dftrends
| Unnamed: 0 | Printing Ink Usage [kg/person/yr] | Population | Printing Ink Usage [Gg/yr] | soaforallA | o3forallA | soaforallB | o3forallB | SOAyieldforscenario [g/g ink] | O3yieldforscenario [g/g ink] | ROC Emissions [Gg/yr] | Water-based Ink Usage [Gg/yr] |
|---|---|---|---|---|---|---|---|---|---|---|---|
| year | |||||||||||
| 2002 | 4.33 | 287625193.0 | 1246.13 | 8.820108 | 1931.5015 | 0.000054 | 49.346748 | 0.006644 | 1.457362 | 735.680688 | 76.429561 |
| 2003 | 4.13 | 290107933.0 | 1199.54 | 8.490344 | 1859.2870 | 0.000052 | 47.501784 | 0.006613 | 1.450780 | 704.946027 | 78.798878 |
| 2004 | 4.76 | 292805298.0 | 1392.59 | 9.856752 | 2158.5145 | 0.000060 | 55.146564 | 0.006665 | 1.461885 | 824.723413 | 81.241643 |
| 2005 | 4.69 | 295516599.0 | 1385.92 | 9.809542 | 2148.1760 | 0.000060 | 54.882432 | 0.006650 | 1.458717 | 818.976929 | 83.760134 |
| 2006 | 4.27 | 298379912.0 | 1275.45 | 9.027635 | 1976.9475 | 0.000055 | 50.507820 | 0.006599 | 1.447736 | 747.968304 | 86.356698 |
| 2007 | 4.23 | 301231207.0 | 1275.02 | 9.024592 | 1976.2810 | 0.000055 | 50.490792 | 0.006584 | 1.444530 | 746.044229 | 89.033756 |
| 2008 | 3.66 | 304093966.0 | 1113.38 | 7.880504 | 1725.7390 | 0.000048 | 44.089848 | 0.006494 | 1.425473 | 642.786281 | 91.793802 |
| 2009 | 3.09 | 306771529.0 | 948.26 | 6.711784 | 1469.8030 | 0.000041 | 37.551096 | 0.006372 | 1.399257 | 537.289111 | 94.639410 |
| 2010 | 3.58 | 309321666.0 | 1107.28 | 7.837328 | 1716.2840 | 0.000048 | 43.848288 | 0.006454 | 1.416904 | 635.383258 | 97.573232 |
| 2011 | 3.58 | 311556874.0 | 1116.93 | 7.905631 | 1731.2415 | 0.000048 | 44.230428 | 0.006441 | 1.413964 | 639.577273 | 100.598002 |
| 2012 | 3.41 | 313830990.0 | 1071.50 | 7.584077 | 1660.8250 | 0.000046 | 42.431400 | 0.006393 | 1.403800 | 609.108521 | 103.716540 |
| 2013 | 3.56 | 315993715.0 | 1124.80 | 7.961334 | 1743.4400 | 0.000048 | 44.542080 | 0.006405 | 1.406410 | 640.608645 | 106.931753 |
| 2014 | 3.26 | 318301008.0 | 1036.63 | 7.337267 | 1606.7765 | 0.000045 | 41.050548 | 0.006325 | 1.389367 | 583.166541 | 110.246637 |
| 2015 | 3.12 | 320635163.0 | 999.19 | 7.072267 | 1548.7445 | 0.000043 | 39.567924 | 0.006273 | 1.378182 | 557.532834 | 113.664283 |
| 2016 | 2.87 | 322941311.0 | 925.76 | 6.552529 | 1434.9280 | 0.000040 | 36.660096 | 0.006182 | 1.358805 | 509.222414 | 117.187875 |
| 2017 | 2.66 | 324985539.0 | 864.06 | 6.115817 | 1339.2930 | 0.000037 | 34.216776 | 0.006088 | 1.338802 | 468.214057 | 120.820700 |
| 2018 | 2.81 | 326687501.0 | 919.17 | 6.505885 | 1424.7135 | 0.000040 | 36.399132 | 0.006119 | 1.345310 | 500.523759 | 124.566141 |
| 2019 | 2.58 | 328239523.0 | 846.14 | 5.988979 | 1311.5170 | 0.000036 | 33.507144 | 0.006004 | 1.320750 | 452.255850 | 128.427692 |
| 2020 | 2.38 | 331511512.0 | 789.52 | 5.588223 | 1223.7560 | 0.000034 | 31.264992 | 0.005891 | 1.296694 | 414.223812 | 132.408950 |
| 2021 | 2.27 | 332031554.0 | 752.65 | 5.327257 | 1166.6075 | 0.000032 | 29.804940 | 0.005794 | 1.276048 | 388.523758 | 136.513628 |
# print Figure 4 data to file
dftrends.drop(columns=['soaforallA','soaforallB','o3forallA','o3forallB']).to_csv(outputdir+'Figure4.csv')
# Figure 4
dftrends['Printing Ink Usage [Gg/yr]']
fig, axes = plt.subplots(nrows=3, ncols=1, figsize=[3.3,6], height_ratios=[1,1,1],gridspec_kw=dict(
wspace=0.0, hspace=0.5, left=0.2,right=0.75,top=0.97,bottom=0.07), dpi=300)
ax=axes[0]
ax.plot(dftrends.index,dftrends['Printing Ink Usage [Gg/yr]'],color='black',label='Total usage')
ax.set_ylabel('Total [Gg/yr]',fontsize=8,labelpad=1)
ax.set_title('(a) U.S. Printing Ink Usage & Emissions',fontsize=8)
ax.set_xlabel('year',fontsize=8,labelpad=1)
ax.set_xticks(np.arange(2002,2021,2))
ax.tick_params(axis='x', rotation=55)
ax.xaxis.set_tick_params(which='major',labelsize=7,pad=0.5,length=1)
ax.plot(dftrends.index,dftrends['ROC Emissions [Gg/yr]'],color='black',label='Total emission',linestyle='dashed')
ax.tick_params(axis='y')
ax.yaxis.set_tick_params(which='major',labelsize=7,pad=0.5,length=1)
ax.legend(loc='lower right',fontsize=7)
ax.set_ylim(-300,1500)
ax2 = ax.twinx()
ax2.plot(dftrends.index,dftrends['Water-based Ink Usage [Gg/yr]'],color='tab:blue',label='Water-based usage',linestyle='dotted')
ax2.set_ylabel('Water-based Usage [Gg/yr]',fontsize=8,color='tab:blue',labelpad=1)
ax2.set_ylim(60,140)
ax2.tick_params(axis='y')
ax2.yaxis.set_tick_params(which='major',labelsize=7,pad=0.5,length=1,labelcolor='tab:blue')
ax.set_zorder(ax2.get_zorder()+1)
ax.set_frame_on(False)
ax=axes[1]
# secondary as yield
ax2 = ax.twinx()
ax2.bar(dftrends.index,dftrends['SOAyieldforscenario [g/g ink]']*1000,color='tab:blue')
ax2.set_ylabel('SOA Yield [g/kg ink]',color='tab:blue',fontsize=8,labelpad=5)
ax2.set_title('(b) SOA Formation Potential',fontsize=8)
ax2.set_ylim(0.00,10)
ax2.tick_params(axis='y')
ax2.yaxis.set_tick_params(which='major',labelsize=7,pad=0.5,length=1,labelcolor='tab:blue')
ax.plot(dftrends.index,dftrends['SOAyieldforscenario [g/g ink]']*dftrends['Printing Ink Usage [Gg/yr]'],color='black')
ax.set_ylabel('SOA [Gg/yr]',fontsize=8,labelpad=10)
ax.set_xlabel('year',fontsize=8,labelpad=3)
ax.set_ylim(0,10)
ax.set_xticks(np.arange(2002,2021,2))
ax.tick_params(axis='x', rotation=55)
ax.xaxis.set_tick_params(which='major',labelsize=7,pad=0.5,length=1,)
ax.set_zorder(ax2.get_zorder()+1)
ax.set_frame_on(False)
ax.tick_params(axis='y')
ax.yaxis.set_tick_params(which='major',labelsize=7,pad=0.5,length=1)
ax=axes[2]
ax2 = ax.twinx()
ax2.bar(dftrends.index,dftrends['O3yieldforscenario [g/g ink]'])
ax2.set_ylabel('O$_3$ [g/g ink]',fontsize=8,color='tab:blue',labelpad=1)
ax.set_title('(c) O$_3$ formation potential',fontsize=8)
ax.set_xlabel('year',fontsize=8)
ax2.set_ylim(0,2)
ax2.tick_params(axis='y')
ax2.yaxis.set_tick_params(which='major',labelsize=7,pad=0.5,length=1,labelcolor='tab:blue')
ax.plot(dftrends.index,dftrends['O3yieldforscenario [g/g ink]']*dftrends['Printing Ink Usage [Gg/yr]'],color='black',zorder=99)
ax.set_ylabel('O$_3$ [Gg/yr]',fontsize=8,labelpad=1)
ax.set_xlabel('year',fontsize=8,labelpad=1)
ax.set_ylim(0,2200)
ax.set_xticks(np.arange(2002,2021,2))
ax.tick_params(axis='x', rotation=55)
ax.xaxis.set_tick_params(which='major',labelsize=7,pad=0.5,length=1,)
ax.set_zorder(ax2.get_zorder()+1)
ax.set_frame_on(False)
ax.tick_params(axis='y')
ax.yaxis.set_tick_params(which='major',labelsize=7,pad=0.5,length=1)
fig.savefig(outputdir + '/'+str(today)+'_Figure4_trends.png', facecolor='w', transparent=False)
# secondary as yield
# stacked bar of change in SOA and O3 due to change in Usage, emission, yield
initialusage = (dftrends[dftrends.index==2002]['Printing Ink Usage [Gg/yr]'].loc[2002] +
dftrends[dftrends.index==2003]['Printing Ink Usage [Gg/yr]'].loc[2003] +
dftrends[dftrends.index==2004]['Printing Ink Usage [Gg/yr]'].loc[2004] +
dftrends[dftrends.index==2005]['Printing Ink Usage [Gg/yr]'].loc[2005] +
dftrends[dftrends.index==2006]['Printing Ink Usage [Gg/yr]'].loc[2006])/5
finalusage = (dftrends[dftrends.index==2017]['Printing Ink Usage [Gg/yr]'].loc[2017] +
dftrends[dftrends.index==2018]['Printing Ink Usage [Gg/yr]'].loc[2018] +
dftrends[dftrends.index==2019]['Printing Ink Usage [Gg/yr]'].loc[2019] +
dftrends[dftrends.index==2020]['Printing Ink Usage [Gg/yr]'].loc[2020] +
dftrends[dftrends.index==2021]['Printing Ink Usage [Gg/yr]'].loc[2021])/5
initialemission = (dftrends[dftrends.index==2002]['ROC Emissions [Gg/yr]'].loc[2002] +
dftrends[dftrends.index==2003]['ROC Emissions [Gg/yr]'].loc[2003] +
dftrends[dftrends.index==2004]['ROC Emissions [Gg/yr]'].loc[2004] +
dftrends[dftrends.index==2005]['ROC Emissions [Gg/yr]'].loc[2005] +
dftrends[dftrends.index==2006]['ROC Emissions [Gg/yr]'].loc[2006])/5
finalemission = (dftrends[dftrends.index==2017]['ROC Emissions [Gg/yr]'].loc[2017] +
dftrends[dftrends.index==2018]['ROC Emissions [Gg/yr]'].loc[2018] +
dftrends[dftrends.index==2019]['ROC Emissions [Gg/yr]'].loc[2019] +
dftrends[dftrends.index==2020]['ROC Emissions [Gg/yr]'].loc[2020] +
dftrends[dftrends.index==2021]['ROC Emissions [Gg/yr]'].loc[2021])/5
initialSOAyieldperusage = (dftrends[dftrends.index==2002]['SOAyieldforscenario [g/g ink]'].loc[2002] +
dftrends[dftrends.index==2003]['SOAyieldforscenario [g/g ink]'].loc[2003] +
dftrends[dftrends.index==2004]['SOAyieldforscenario [g/g ink]'].loc[2004] +
dftrends[dftrends.index==2005]['SOAyieldforscenario [g/g ink]'].loc[2005] +
dftrends[dftrends.index==2006]['SOAyieldforscenario [g/g ink]'].loc[2006])/5
finalSOAyieldperusage = (dftrends[dftrends.index==2017]['SOAyieldforscenario [g/g ink]'].loc[2017] +
dftrends[dftrends.index==2018]['SOAyieldforscenario [g/g ink]'].loc[2018] +
dftrends[dftrends.index==2019]['SOAyieldforscenario [g/g ink]'].loc[2019] +
dftrends[dftrends.index==2020]['SOAyieldforscenario [g/g ink]'].loc[2020] +
dftrends[dftrends.index==2021]['SOAyieldforscenario [g/g ink]'].loc[2021])/5
initialo3yieldperusage = (dftrends[dftrends.index==2002]['O3yieldforscenario [g/g ink]'].loc[2002] +
dftrends[dftrends.index==2003]['O3yieldforscenario [g/g ink]'].loc[2003] +
dftrends[dftrends.index==2004]['O3yieldforscenario [g/g ink]'].loc[2004] +
dftrends[dftrends.index==2005]['O3yieldforscenario [g/g ink]'].loc[2005] +
dftrends[dftrends.index==2006]['O3yieldforscenario [g/g ink]'].loc[2006])/5
finalo3yieldperusage = (dftrends[dftrends.index==2017]['O3yieldforscenario [g/g ink]'].loc[2017] +
dftrends[dftrends.index==2018]['O3yieldforscenario [g/g ink]'].loc[2018] +
dftrends[dftrends.index==2019]['O3yieldforscenario [g/g ink]'].loc[2019] +
dftrends[dftrends.index==2020]['O3yieldforscenario [g/g ink]'].loc[2020] +
dftrends[dftrends.index==2021]['O3yieldforscenario [g/g ink]'].loc[2021])/5
# Gg/yr changes
SOAchangeduetousage = ( finalusage - initialusage ) * initialSOAyieldperusage
SOAchangeduetoemiss = ( finalemission - initialemission ) * initialSOAyieldperusage * initialusage/initialemission - SOAchangeduetousage
SOAchangeduetoyield = ( finalusage * finalSOAyieldperusage ) - (initialusage * initialSOAyieldperusage ) - SOAchangeduetousage - SOAchangeduetoemiss
print('Change in usage: ',initialusage,',',finalusage)
print('Change in emission: ',initialemission,',',finalemission)
print('Change in SOA yield: ',initialSOAyieldperusage,',',finalSOAyieldperusage)
print('Change in SOA due to usage:', SOAchangeduetousage,',',SOAchangeduetoemiss,',',SOAchangeduetoyield)
o3changeduetousage = ( finalusage - initialusage ) * initialo3yieldperusage
o3changeduetoemiss = ( finalemission - initialemission ) * initialo3yieldperusage * initialusage/initialemission - o3changeduetousage
o3changeduetoyield = ( finalusage * finalo3yieldperusage ) - (initialusage * initialo3yieldperusage ) - o3changeduetousage - o3changeduetoemiss
print('Change in O3 yield per usage: ',initialo3yieldperusage,',',finalo3yieldperusage)
print('Change in O3 due to usgae: ',o3changeduetousage,',',o3changeduetoemiss,',',o3changeduetoyield)
Change in usage: 1299.926 , 834.308 Change in emission: 766.4590721958398 , 444.7482471734873 Change in SOA yield: 0.0066342031701869305 , 0.00597919610187837 Change in SOA due to usage: -3.0890044116960977 , -0.530791648704239 , -0.015685988442139642 Change in O3 yield per usage: 1.45529601525558 , 1.315520840586781 Change in O3 due to usgae: -677.6120200312726 , -116.43583283091618 , -0.17971359666023545
# Relative composition, SOA, O3
fig, axes = plt.subplots(nrows=1, ncols=3, figsize=[6.5,3], gridspec_kw=dict(
wspace=0.0, hspace=0.0, left=0.08,right=0.74,top=0.91,bottom=0.27), dpi=300)
plotdata = dfmeasured[['species','T2_emiss_g','T3_emiss_g','T4_emiss_g','est_soa_yield','est_mir','URE\n1/(ug/m3)','RFC\n(mg/m3)']].copy()
plotdata.rename(columns={"T4_emiss_g": "A_emiss_g"},inplace=True)
plotdata.rename(columns={"T2_emiss_g": "B_emiss_g"},inplace=True)
plotdata.rename(columns={"T3_emiss_g": "C_emiss_g"},inplace=True)
plotdata.replace('NR',np.nan,inplace=True)
plotdata.replace('ND',np.nan,inplace=True)
axid = 0
# Calculate SOA, O3, cancer risk, noncancer risk by test, absolute values
for test in ['A','B','C']:
var = test + '_emiss_g'
print('-------'+var+' by fraction-------')
plotdata['Emissions']=plotdata[var]
plotdata['SOA']=plotdata[var]*plotdata['est_soa_yield']
plotdata['O$_3$']=plotdata[var]*plotdata['est_mir']
plotdata['Cancer']=plotdata[var]*plotdata['URE\n1/(ug/m3)']
plotdata['Noncancer']=plotdata[var]/plotdata['RFC\n(mg/m3)']
# normalize to total
plotdata['Emissions']=plotdata['Emissions']/plotdata['Emissions'].sum()
plotdata['SOA']=plotdata['SOA']/plotdata['SOA'].sum()
plotdata['O$_3$']=plotdata['O$_3$']/plotdata['O$_3$'].sum()
plotdata['Cancer']=plotdata['Cancer']/plotdata['Cancer'].sum()
plotdata['Noncancer']=plotdata['Noncancer']/plotdata['Noncancer'].sum()
pplotdata=plotdata[['Emissions','SOA','O$_3$','Cancer','Noncancer','species']]
pplotdata.set_index('species',inplace=True)
print(pplotdata)
Tplotdata=pplotdata.T
Tplotdata.plot.bar( ax=axes[axid], stacked=True, ylabel='species fractional contribution', width = 0.9, colormap='tab20',fontsize=8)
axes[axid].set_title('Ink '+test,fontsize=8)
axes[axid].set_ylim(0,1)
if axid>0:
axes[axid].yaxis.set_tick_params(labelleft=False)
axes[axid].set_yticks([])
axes[axid].set_ylabel('')
axid = axid+1
axes[0].get_legend().remove()
axes[1].get_legend().remove()
axes[2].get_legend().remove()
handles, labels = axes[0].get_legend_handles_labels()
axes[2].legend(handles[::-1], labels[::-1],loc='center right', bbox_to_anchor=(2.145, -0.05,0.02,0.8),fontsize=8,labelspacing=0.22 )# reverse order of labels so they match stacking # x,y,width, height bbox
fig.savefig(outputdir + '/'+str(today)+'_Figure2_relative_potential.png', facecolor='w', transparent=False)
-------A_emiss_g by fraction-------
Emissions SOA O$_3$ Cancer Noncancer
species
Formaldehyde NaN NaN NaN NaN NaN
Acetaldehyde 2.629520e-04 0.000000 7.976629e-04 1.0 0.990321
Unknown as Acetone NaN NaN NaN NaN NaN
Butanal NaN NaN NaN NaN NaN
Hexaldehyde NaN NaN NaN NaN NaN
Methanol 1.540007e-03 0.000000 2.304740e-03 0.0 0.002610
Isopropyl_Alcohol 3.369600e-04 0.000000 3.575999e-04 NaN NaN
Total SVOCs NaN NaN NaN NaN NaN
Acetone 1.004600e-03 0.000000 6.261716e-04 NaN NaN
Propionaldehyde 1.660578e-06 0.000000 4.512638e-06 0.0 0.007036
2-Butanone (MEK) 3.366071e-03 0.000000 2.594987e-03 NaN NaN
3-Pentanone 5.074006e-01 0.976860 3.503929e-01 NaN NaN
Benzaldehyde 9.844195e-07 0.000002 6.864893e-07 NaN NaN
Ethanol 4.625566e-01 0.000000 6.065047e-01 NaN NaN
Ethyl_Acetate 7.251737e-03 0.000000 5.594033e-03 NaN NaN
Toluene 4.923655e-06 0.000145 7.991752e-06 0.0 0.000033
Alkane 1.282262e-04 0.000175 6.323938e-05 NaN NaN
PAH 2.539939e-04 0.007323 3.646765e-04 NaN NaN
Glycol 1.332006e-02 0.000000 1.948494e-02 NaN NaN
SubBenzene 2.570572e-03 0.015494 1.090110e-02 NaN NaN
-------B_emiss_g by fraction-------
Emissions SOA O$_3$ Cancer Noncancer
species
Formaldehyde 0.000307 0.0 0.000679 0.621322 0.167866
Acetaldehyde 0.001107 0.0 0.002190 0.378678 0.658295
Unknown as Acetone 0.016468 0.0 0.006691 NaN NaN
Butanal NaN NaN NaN NaN NaN
Hexaldehyde 0.000260 1.0 0.000368 NaN NaN
Methanol 0.649822 0.0 0.633933 0.000000 0.173838
Isopropyl_Alcohol 0.010545 0.0 0.007295 NaN NaN
Total SVOCs 0.321490 0.0 0.348844 NaN NaN
Acetone NaN NaN NaN NaN NaN
Propionaldehyde NaN NaN NaN NaN NaN
2-Butanone (MEK) NaN NaN NaN NaN NaN
3-Pentanone NaN NaN NaN NaN NaN
Benzaldehyde NaN NaN NaN NaN NaN
Ethanol NaN NaN NaN NaN NaN
Ethyl_Acetate NaN NaN NaN NaN NaN
Toluene NaN NaN NaN NaN NaN
Alkane NaN NaN NaN NaN NaN
PAH NaN NaN NaN NaN NaN
Glycol NaN NaN NaN NaN NaN
SubBenzene NaN NaN NaN NaN NaN
-------C_emiss_g by fraction-------
Emissions SOA O$_3$ Cancer Noncancer
species
Formaldehyde 0.001371 0.0 0.003008 0.166142 0.029848
Acetaldehyde 0.040667 0.0 0.079917 0.833858 0.963891
Unknown as Acetone 0.078113 0.0 0.031542 NaN NaN
Butanal 0.000349 0.0 0.000563 NaN NaN
Hexaldehyde 0.001329 1.0 0.001869 NaN NaN
Methanol 0.587017 0.0 0.569125 0.000000 0.006261
Isopropyl_Alcohol NaN NaN NaN NaN NaN
Total SVOCs 0.291154 0.0 0.313975 NaN NaN
Acetone NaN NaN NaN NaN NaN
Propionaldehyde NaN NaN NaN NaN NaN
2-Butanone (MEK) NaN NaN NaN NaN NaN
3-Pentanone NaN NaN NaN NaN NaN
Benzaldehyde NaN NaN NaN NaN NaN
Ethanol NaN NaN NaN NaN NaN
Ethyl_Acetate NaN NaN NaN NaN NaN
Toluene NaN NaN NaN NaN NaN
Alkane NaN NaN NaN NaN NaN
PAH NaN NaN NaN NaN NaN
Glycol NaN NaN NaN NaN NaN
SubBenzene NaN NaN NaN NaN NaN