elwood_spatial.air_quality
Domain-specific utilities for air quality monitoring. Provides EPA-compliant AQI bin presets and PM2.5 ↔ AQI conversion functions based on 40 CFR 58 Appendix G breakpoints.
Presets
AQI_BINS
Standard EPA 6-bin AQI categories.
| Bin | Range | Category |
|---|---|---|
| 0 | 0 – 50 | Good |
| 1 | 51 – 100 | Moderate |
| 2 | 101 – 150 | Unhealthy for Sensitive Groups |
| 3 | 151 – 200 | Unhealthy |
| 4 | 201 – 300 | Very Unhealthy |
| 5 | 301 – 500 | Hazardous |
AQI_MODIFIED_BINS
Modified 12-bin percentile categories from the paper, with transition zones at category boundaries.
| Bin | Range | Label |
|---|---|---|
| 0 | 0 – 44.9 | G |
| 1 | 45 – 55.9 | GM |
| 2 | 56 – 95 | M |
| 3 | 95.1 – 105.9 | MUSG |
| 4 | 106 – 145 | USG |
| 5 | 145.1 – 155.9 | USGU |
| 6 | 156 – 195 | U |
| 7 | 195.1 – 210.9 | UVU |
| 8 | 211 – 290 | VU |
| 9 | 290.1 – 320.9 | VUH |
| 10 | 321 – 500 | H |
| 11 | 501 – 99999 | BH |
pm25_to_aqi(pm25)
Convert a PM2.5 concentration (µg/m³) to an AQI value using EPA breakpoints.
| Parameter | Type | Description |
|---|---|---|
pm25 | float | PM2.5 concentration |
Returns int | None. Returns None for None input, 0 for negative values.
from elwood_spatial.air_quality import pm25_to_aqi
pm25_to_aqi(35.0) # => 100
pm25_to_aqi(55.4) # => 150 aqi_to_pm25(aqi)
Inverse conversion — AQI value to PM2.5 concentration.
| Parameter | Type | Description |
|---|---|---|
aqi | float | AQI value |
Returns float | None. Rounded to 1 decimal place.