Skip to content

Instantly share code, notes, and snippets.

View barronh's full-sized avatar

Barron H. Henderson barronh

View GitHub Profile
@barronh
barronh / epacolors.py
Created November 7, 2025 16:06
matplotlib aqi colorscale
def get_epacmapnorm(spc, freq):
"""
Arguments
---------
spc : str
choices 'pm25' or 'o3'
freq : str
choices '1h', '24h' (pm-only), '8h' (o3-only), 'mda8' (o3-only)
Returns
@barronh
barronh / cmaq2geotiff.py
Created September 5, 2025 14:28
CMAQ to GeoTIFF
"""
# Convert a CMAQ IOAPI File to a GeoTiff
---
author: Barron H. Henderson
last updated: 2025-09-05
---
Demonstrates converting a CMAQ file to a GeoTiff. GeoTiff is useful for ArcGIS or QGIS.
@barronh
barronh / csv2inln.py
Created May 23, 2025 20:10
Convert a CSV File into a CMAQ-ready point source files.
__all__ = ['open_griddesc', 'csv2inln', 'templatecsv']
__doc__ = """
csv2inln
========
This module is meant to help make CMAQ-ready point source emission files from
a CSV file. By default, the emissions are time-independent for a day. However,
a tfactor_utc variable can be supplied to add a diurnal scaling factor.
Prerequisites
@barronh
barronh / README.md
Last active May 22, 2025 17:59
EQUATES Evaluation

EQUATES Evaluation Quick Hits

@barronh
barronh / airnowcompare.py
Last active April 26, 2025 15:08
Compare AirNow and NAQFC
__version__ = "1.0.0"
__all__ = ['open_remote', 'open_naqfc', 'open_airnow', 'open_airfuse']
__doc__ = """
Utility for Comparing AirNow Surfaces
=====================================
Using AirNow grib2 AQI files as reference. Can compare to NAQFC from NOAA or
the AirFuse from AirNow. For simplicity, NAQFC and AirFuse are converted to
a Nowcast by averaging the last 3 time steps. The Nowcast is then put into AQI
units for comparison.
@barronh
barronh / gridcensus.py
Last active April 18, 2025 16:52
Create gridded CENSUS metrics that are useful for Health Benefit Assessments
__doc__ = """
Grid US Census Demographic Profile
==================================
Produce gridded TIGER Demographic Profile files for a subset of variables in
the an American Community Survey from either a 1-year or 5-year input files.
Requires:
- python>=3.7
- numpy
@barronh
barronh / quicksummary.py
Last active April 24, 2025 22:41
Summary of Criteria or Hazardous Air Pollutants by 60 EIS sectors.
__doc__ = """
NEI Emission Summary
====================
---
author: Barron H. Henderson
last updated: 2025-04-17
---
Simple script to get Criteria or Hazardous Air Pollutants by 60 EIS emission
@barronh
barronh / README.md
Last active September 18, 2025 11:03
Monitor Coverage

County and Population Coverage of Monitors

The incomplete spatial coverage of monitors is a good motivation for data fusion. Monitors cover less than 30% of US counties, but more like 70% of the population. This is because dense populations often coincide with sources of polution and, therefore, are better monitored. The precise coverage of monitoring data depends on the period of interest. For example, ozone monitors are often not depolyed during winter.

@barronh
barronh / tempo_cloudrasterformat.ipynb
Created March 26, 2025 20:40
TEMPO_CloudRasterFormat.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@barronh
barronh / emgsatemis.py
Created March 12, 2025 13:20
Satellite Derived Emissions from Exponentially Modified Gaussian
__version__ = '0.2.0'
__doc__ = """EMG Satellite-derived Emissions
===============================
EMG Satellite-derived Emissions (emgsatemis) is designed to estimate emissions
from satellite data following many previous studies based on Bierle et al.
Functions:
- to_polar(x, y, degrees=False)
- to_cartesian(r, alpha, theta=0, degrees=False)