DOI: 10.5061/dryad.mcvdnck6g
title: Nitrogen dioxide exposure, health outcomes, and associated demographic disparities due to gas and propane combustion by US stoves

description: Gas and propane stoves emit nitrogen dioxide (NO2) pollution indoors, but
 the exposures of different U.S. demographic groups are unknown. We
 estimate NO2 exposure and health consequences using emissions and
 concentration measurements from &gt;100 homes, a room-specific indoor
 air quality model, epidemiological risk parameters, and statistical
 sampling of published housing characteristics and occupant behavior. Gas
 and propane stoves increase long-term NO2 exposure by an estimated 4.0
 ppbv on average across the United States, 75% of the World Health
 Organization (WHO)’s exposure guideline. This increased exposure may cause
 approximately 50 thousand cases of current pediatric asthma from long-term
 NO2 exposure alone. Short-term NO2 exposure from typical gas stove use
 frequently exceeds both World Health Organization and U.S. EPA benchmarks.
 Residents of residences &lt;800 ft2 in size incur 4 times more
 long-term NO2 exposure than residents of residences &gt;3000 ft2 in
 size; American Indian/Alaska Native and Black and Hispanic/Latino
 households incur 60% and 20% more NO2 exposure, respectively, than the
 national average.
description: # Code Documentation for “Nitrogen dioxide exposure, health outcomes, and
 associated demographic disparities due to gas and propane combustion by US
 stoves” This document describes how to re-create the analysis in the
 manuscript “Nitrogen dioxide exposure, health outcomes, and associated
 demographic disparities due to gas and propane combustion by US stoves.”
 ## **Folder Architecture and Description** Unless column headers are
 explained elsewhere, every folder containing .csv files also contains a
 .txt file explaining every column header of each .csv in the folder in
 question. This .txt file is titled “Column_names.” ``` |––_DICTS: Python
 dictionaries containing measured CH4, CO2, NO, and NO2 emission rates, as
 well as emission factors (normalized by J of gas burned). See
 CONTAM_SCALEUP.ipynb for more information. |––_TABLES: |     |––
 df_nox_all_long_timecourse_py.csv: Dataframe containing measured NO, NO2,
 and NOx concentrations during long timecourse measurements |     |––
 df_nox_all_long_timecourse_py.parquet: Same as
 df_nox_all_long_timecourse_py.csv, but stored as a parquet |     |––
 notes_long_timecourse_combined_py.csv: Dataframe containing notes of long
 timecourse measurments. |     |–– notes_long_timecourse_py.csv: A
 truncated version of notes_long_timecourse_combined_py.csv required by the
 code. |     |––Column_names.txt: Legend for column names in all .csvs in
 the folder ``` ``` |––CONTAM_SCALEUP: Folder containing files required to
 run CONTAM_SCALEUP.ipynb | | |––_DICTS: Empty folder into which Python
 dictionaries are saved if “run_floorplans” and “calculate_dicts” are set
 to “True” in CONTAM_SCALEUP.ipynb | | |––_TABLES: tables produced by
 CONTAM_SCALEUP.ipynb: | | | |––RECS_full.csv: table of calculated exposure
 values associated with each RECS house (see Methods). Column headers in
 the original RECS table are decoded in RECS 2020 Codebook for Public File
 - v3.xlsx. The rest of the columns are variables calculated in
 CONTAM_SCALEUP.ipynb (see code). | | | |–– RECS 2020 Codebook for Public
 File - v3.xlsx: decoding file for RECS_full.csv | | |––DATABASE_HOUSES:
 CONTAM files and support files required to run them. Most files in this
 folder are explained below in “Running the CONTAM model.” The remaining
 files are: simread.exe, with a copy present in each floorplan folder
 (AH-1, AH-3, AH-8, etc…). simread.exe is a helper app used to generate
 .ncr output files. responses_template.txt is a helper text used to
 generate .ncr files. responses_template_commented.txt explains entries in
 this text file. Reach floorplan folder also contains an empty Results
 folder into which modeled NO2 concentrations are saved when CONTAM is run.
 | | |––Occupancy: .csv files containing the occupancy schedules used for
 modeling: | | | |––high.csv: occupancy schedule corresponding with 95th
 percentile kitchen occupancy. | | | |––medium.csv: occupancy schedule
 corresponding with 50th percentile kitchen occupancy | | | |––low.csv:
 occupancy schedule corresponding with 5th percentile kitchen occupancy | |
 | |––Column_names.txt: Legend for column names in all .csvs in the folder
 | | |––Usage and Movement Data: .csv files used in CONTAM_SCALEUP.ipynb: |
 | | |––emission_factors_propane.csv: propane emission factors measured in
 this work | | | |––emission_factors_gas.csv: gas emission factors measured
 in this work | | | |––contam_distribution.csv: the slope of gas emission
 vs. long- and short-term exposure for each modeled scenario, and its
 weight | | | |––recs2020_public_v3.csv: RECS housing data frame. Headers
 explained by codebook, below. | | | |––RECS 2020 Codebook for Public File
 - v3.xlsx: Codebook for recs2020_public_v3.csv | | | |––wstation-wind.csv:
 Ground windspeed in the U.S. | | | |––U.S. Mortality
 Table_2016_trimmed_notes.csv: Total mortality by U.S. state in 2016 | | |
 |––AsthmaPrevalence.csv: Pediatric asthma prevalence by state | | |
 |––instance_weights.pkl: Python dictionary containing CONTAM scenario
 weights | | | |––Column_names.txt: Legend for column names in all .csvs in
 the folder | | |––Weather_analysis.ipynb: Python code to calculate average
 ground windspeeds (see below) ``` ``` | |––CONTAM_VERIFICATION: Folder
 containing files required to run CONTAM_Verification.ipynb: | |
 |––_TABLES: dataframes containing raw NO2 measurements for CONTAM
 verification: | | | |–– df_nox_contam_verification.csv: Dataframe
 containing measured NO, NO2, and NOx concentrations during CONTAM
 verification measurements | | | |–– df_nox_contam_verification.parquet:
 parquet version of df_nox_contam_verification.csv | | | |––
 df_nox_modeled: Dataframe containing modeled CO2 and NO2 concentrations
 during CONTAM verification measurements | | | |––Column_names.txt: Legend
 for column names in all .csvs in the folder | |
 |––All_notes_long_timecourses.csv: Notes for CONTAM verification
 measurements | | |––Master_Validation_Spreadsheet.csv: Helper document for
 running CONTAM validation | | |–– Column_names.txt: Legend for column
 names in all .csvs in the folder | | |––CONTAM projects: CONTAM
 verification files and support files required to run them. Most files in
 this folder are explained below in “Running the CONTAM model.” The
 remaining files are: simread.exe, contamx3.exe, the Data folder, and the
 Results folder, with copies present in each floorplan folder (T0501,
 T0601, etc…). simread.exe is a helper app used to generate .ncr output
 files. contamx3.exe is a copy of the CONTAM software. The Data folder
 contains two folders: NOx and NOx_Modeled. Each NOx folder contains one
 .csv with measured NOx concentrations. There are four headers: DateTime,
 the date and time of the measurement; NOX, the NOx concentration in ppbv;
 NO, the NO concentration in ppbv; and NO2, the NO2 concentration in ppbv.
 Each NOx_Modeled folder contains one .txt and .csv showing the modeled NO2
 in a given room (Kitchen, Livingroom, etc…). The columns are: date, the
 arbitrary modeled date; time of day, the modeled time; time [s], the
 modeled time in seconds elapsed; N2, the N2 concentration (kg/kg); O2, the
 O2 concentration (kg/kg); Ar, the Ar concentration (kg/kg); CO2, the CO2
 concentration (kg/kg); H2O, the H2O concentration (kg/kg); Benzene, the
 modeled benzene concentration (ppbv); NO, all zeros since NO was not
 modeled; NO2, the modeled NO2 concentration (ppbv). ``` The Results folder
 in each floorplan folder contains four files corresponding with low,
 medium, high, and very high bi-directional flowrates (see Methods). Each
 .csv file reports modeled NO2 concentrations in each room. The columns
 are: Date, the arbitrary modeled date; Time, the modeled time; Ctm; the
 contaminant number in CONTAM; Bedroom2, the NO2 concentration (ppbv) in
 the closest bedroom from the kitchen; Kitchen, the NO2 concentration
 (ppbv) in the kitchen; Bedroom1, the NO2 concentration (ppbv) in the
 farthest bedroom from the kitchen; Livingroom, the NO2 concentration
 (ppbv) in the living room. ``` | |––Figures_jpg: Empty folder into which
 .jpg figures are saved when code is run (see below) | |––Figures_pdf:
 Empty folder into which .pdf figures are saved when code is run (see
 below) | |––Figures_png: Empty folder into which .png figures are saved
 when code is run (see below) | |–– NOXlinear_Lebel_et_al.csv: Dataframe
 containing measured CO2, NO, NO2 emission rates measured from induction
 cooktops in this work | |––allLinear_elec_NOx_paper.csv: Dataframe
 containing measured CO2, NO, NO2 emission rates measured in this work |
 |––allLinear_elec_NOx_paper: Dataframe containing measured CO2, NO, NO2
 emission rates measured from induction cooktops in this work |
 |––CONTAM_HELPER.ipynb: Jupyter notebook used to convert .ncr CONTAM
 outputs into .csv files containing modeled NO2 concentrations |
 |––CONTAM_Verification.ipynb: Jupyter notebook used to validate the CONTAM
 model (see below) | |––CONTAM_SCALEUP.ipynb: Jupyter notebook used to
 model NO2 exposures across the U.S. (see below) | |––NOx Analysis.ipynb:
 Jupyter notebook used to analyze and plot measured NO2 flowrates (see
 below) | |––Column_names.txt: Legend for column names in all .csvs in the
 folder | |–– README.docx: This document ``` ##  **Running the Code**
 Running the code and CONTAM files contained herein require: 1\)    Python
 3.12.2
 ([https://www.python.org/downloads/](https://www.python.org/downloads/))
 and associated packages. Note that this may require importing packages
 using pip3. 2\)    JupyterLab
 ([https://jupyter.org/](https://jupyter.org/)) 3\)    CONTAM
 ([https://www.nist.gov/el/energy-and-environment-division-73200/nist-multizone-modeling/software/contam/download](https://www.nist.gov/el/energy-and-environment-division-73200/nist-multizone-modeling/software/contam/download)) Unless otherwise noted, all Python code was run using JupyterLab on a Firefox browser on Mac OS 14.3.1 (Sonoma). All CONTAM X and CONTAM W was run on a Windows 11 Home. ### **Figures** Figures generated by the code are saved to folders titled “Figures_,” where is png, jpg, and pdf. ### **Applying CONTAM to RECS Database** File **CONTAM_SCALEUP.ipynb** reproduces the calculations and plots applying the 24 modeled CONTAM floorplans to the RECS database. Figures 4, 5, S5, S6, S12, and S13 can be reproduced using this code. This code also performs the calculations used to produce the values in Table 1. A single dataframe containing the contents of Data S1, S2, and S3 is produced using this code. See in-line comments for more details. ### **Validation of CONTAM model** File **CONTAM_VALIDATION.ipynb** reproduces the calculations and plots used in validating the CONTAM model. Figures 1, S1, S2, S4, and S10 can be reproduced using this code. This code also performs the calculations used to produce the values in Tables S1 and S5. See in-line comments for more details. ### **Analysis of NO2 Emission Rates and Long Timecourses** File **NOx Analysis.ipynb** reproduces the calculations and plots used to analyze NO2 emission rates reported in this work and by Lebel et al. Raw emission rates from each gas or propane stove and each electric stove are located in **allLinear_NOx_paper.csv** and **allLinear_elec_NOx_paper.csv**, respectively (NOx emissions from electric stoves were indistinguishable from zero). Emission rates reported by Lebel et al. are in **NOXlinear_Eric_paper.csv**. Figures 2, 3, S3, S14, and S15 can be reproduced using this code. This code also performs the calculations used to produce the values in Tables S3 and S4. See in-line comments for more details. ### **Calculation of average ground windspeeds** File **Weather_analysis.ipynb** calculates average hourly groundlevel windspeeds based on data from the National Oceanic and Atmospheric Association.  ### **Running the CONTAM Model** To calculate time-resolved modeled NO2 concentrations for a given floorplan under the 1296 combinations of input parameters: First, using a Windows operating system, 1\)    Navigate to CONTAM_SCALEUP &gt; DATABASE_HOUSES  and open **ContamFactorial.exe**. When prompted, first select the file **values.txt** in the same directory, then navigate to the folder of the floorplan in question and select the file .prj, where is the floorplan’s name. Do *not* select any one of the other .prj files with longer names. Wait for ContamFactorial to finish. Note: the input parameters are encoded in the **values.txt** file. This file can be edited to change the scenarios modeled. 2\)    Once all the .prj files have been produced, navigate to the given floorplan’s folder and run **run-cs-all-simple.py**. One can use IDLE or a similar shell for this. 3\)    Repeat for as many floorplans as desired. 4\)    Once all the models have run, open **automate_symread.ipynb** (in DATABASE_HOUSES) using JupyterLab. List the floorplan or floorplans in question in the array “houses,” with each name as a string. Run the file. Switch to Mac OS: 5\)    Open **CONTAM_HELPER.ipynb** in Jupyter Lab, set the variable “mode” in the second block to ‘Scaleup.’ List the floorplan or floorplans in question in the array “houses,” with each name as a string. Run the file. The process to re-calculate time-resolved modeled NO2 concentrations for the CONTAM validation houses under one of four levels of bi-directional flow elements is similar to the above: First, using a Windows operating system, 1\)    Navigate to CONTAM_VERIFICATION &gt; CONTAM projects and open **ContamFactorial.exe**. When prompted, first select the file **Verification_values.txt** in the same directory, then navigate to the folder of the floorplan in question and select the file .prj, where is the floorplan’s name. Do *not* select any one of the other .prj files with longer names. Wait for ContamFactorial to finish. Note: the input parameters are encoded in the **Verification_values.txt** file. This file can be edited to change the scenarios modeled. 2\)    Once all the .prj files have been produced, navigate to the given floorplan’s folder and run **run-cs-all-simple.py**. One can use and IDLE or similar shell for this. 3\)    Repeat for as many floorplans as desired. 4\)    Once all the models have run, open **verification_automate_symread.ipynb** (in CONTAM projects) using JupyterLab. List the floorplan or floorplans in question in the array “houses,” with each name as a string. Run the file. Switch to Mac OS: 5\)    Open **CONTAM_HELPER.ipynb** in Jupyter Lab, set the variable “mode” in the second block to ‘Verification.’ List the floorplan or floorplans in question in the array “houses,” with each name as a string. Run the file.