danielrosehill commited on
Commit
6d5cf74
·
1 Parent(s): bdd6ce8

Add meteorological deweathering layer + Canadian AQHI

Browse files

- weather_hourly.parquet: hourly T/RH/wind/BLH/pressure/precip from Open-Meteo (ERA5) for Jerusalem, London, NYC across the full 12-month window.
- jlm_deweathered.parquet / control_deweathered.parquet: pollutant series with weather variance removed via Random Forest (openair deweather::buildMod port). Hour-of-day and day-of-week deliberately excluded from features so Shabbat and diurnal signals survive in residuals.
- aqi_hourly.parquet: refreshed with Canadian AQHI (additive, NO2+O3+PM2.5, mortality-weighted) computed at city level since no single station measures all three.
- New figures 15 (raw vs deweathered Shabbat effect) and 16 (deweathered cross-city).
- README updated with weather and deweathered schemas plus headline weather-controlled drops: NO2 -34% (vs -59% raw), PM paradoxes dissolve once weather is controlled.

README.md CHANGED
@@ -26,6 +26,18 @@ configs:
26
  data_files:
27
  - split: train
28
  path: data/aqi_hourly.parquet
 
 
 
 
 
 
 
 
 
 
 
 
29
  ---
30
 
31
  ![Banner](banner.png)
@@ -159,6 +171,61 @@ AQI, and two activity-isolating indices.
159
  | AQI averaging windows | `pm25_24h`, `pm10_24h`, `o3_8h`, `co_8h` | Rolling means as required by EPA AQI breakpoints |
160
  | EPA AQI sub-indices | `aqi_pm25`, `aqi_pm10`, `aqi_o3`, `aqi_no2`, `aqi_co` | Linear-interpolated per-pollutant sub-indices using EPA breakpoints |
161
  | Composite AQI | `aqi_epa`, `aqi_dominant`, `aqi_category` | Max of sub-indices; name of the pollutant driving it; verbal band (Good / Moderate / Unhealthy / …) |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  | **Traffic-Combustion Index** | `tci`, `tci_n_inputs` | Mean of per-station z-scores (vs `segment == 'weekday'` daytime baseline) of NO₂, NO, NOx, CO, benzene, toluene. Negative = below the workweek norm. |
163
  | **Photochemical/Dust Index** | `pd_index`, `pd_n_inputs` | Mean of z-scores of O₃ + PM2.5. Moves opposite to TCI on Shabbat — captures the "wrong-way" pollutants. |
164
 
@@ -296,21 +363,30 @@ paradox: composite EPA AQI **barely moves** between workweek and Shabbat
296
  because particulate matter dominates the index, and PM in Jerusalem is
297
  driven by long-range dust as much as by local emissions.
298
 
299
- | Segment | EPA AQI (mean) | TCI (z) | PD-Index (z) |
300
- |---|---:|---:|---:|
301
- | Workweek (Sun–Thu) | 64 | −0.10 | −0.05 |
302
- | Pre-Shabbat (2h) | 63 | −0.58 | +0.20 |
303
- | **Shabbat** | **67** | **−0.61** | **+0.15** |
304
- | Post-Havdalah (2h) | 69 | −0.17 | +0.06 |
305
- | Yom Tov | 71 | −0.66 | +0.03 |
306
- | **Yom Kippur** | **28** | **−0.90** | **−0.55** |
307
-
308
- The Traffic-Combustion Index plunges by half a standard deviation on
309
- Shabbat (and almost a full standard deviation on Yom Kippur) while the
310
- Photochemical/Dust Index drifts the other way exactly as the urban
311
- NOx-saturated photochemistry would predict. The composite EPA AQI is too
312
- coarse a summary for this question; the activity-isolating indices are
313
- what the data really shows.
 
 
 
 
 
 
 
 
 
314
 
315
  ## Halachic time-window methodology
316
 
 
26
  data_files:
27
  - split: train
28
  path: data/aqi_hourly.parquet
29
+ - config_name: weather_hourly
30
+ data_files:
31
+ - split: train
32
+ path: data/weather_hourly.parquet
33
+ - config_name: jlm_deweathered
34
+ data_files:
35
+ - split: train
36
+ path: data/jlm_deweathered.parquet
37
+ - config_name: control_deweathered
38
+ data_files:
39
+ - split: train
40
+ path: data/control_deweathered.parquet
41
  ---
42
 
43
  ![Banner](banner.png)
 
171
  | AQI averaging windows | `pm25_24h`, `pm10_24h`, `o3_8h`, `co_8h` | Rolling means as required by EPA AQI breakpoints |
172
  | EPA AQI sub-indices | `aqi_pm25`, `aqi_pm10`, `aqi_o3`, `aqi_no2`, `aqi_co` | Linear-interpolated per-pollutant sub-indices using EPA breakpoints |
173
  | Composite AQI | `aqi_epa`, `aqi_dominant`, `aqi_category` | Max of sub-indices; name of the pollutant driving it; verbal band (Good / Moderate / Unhealthy / …) |
174
+ | Canadian AQHI | `aqhi`, `aqhi_band` | Health Canada's additive, mortality-risk-weighted index of NO₂ + O₃ + PM2.5 (3-hour rolling means). Computed at *city* level (no single Jerusalem station measures all three pollutants) and broadcast to every station-row at that hour. Bands: Low 1–3, Moderate 4–6, High 7–10, Very High 11+. |
175
+
176
+ ### `data/weather_hourly.parquet` — meteorological covariates
177
+
178
+ Hourly weather from [Open-Meteo's Historical Weather API](https://open-meteo.com/en/docs/historical-weather-api) (ERA5-backed reanalysis), one row per (`city`, `timestamp_utc`):
179
+
180
+ | column | description |
181
+ |---|---|
182
+ | `city` | `Jerusalem`, `London`, or `New York` |
183
+ | `timestamp_utc` | UTC hour |
184
+ | `temperature_2m` | °C at 2 m |
185
+ | `relative_humidity_2m` | % at 2 m |
186
+ | `wind_speed_10m` | m/s at 10 m |
187
+ | `wind_direction_10m` | degrees at 10 m |
188
+ | `pressure_msl` | hPa, sea-level reduced |
189
+ | `boundary_layer_height` | m — most important variable for surface pollution (low BLH traps emissions) |
190
+ | `precipitation` | mm |
191
+
192
+ Used for meteorological normalisation in `jlm_deweathered.parquet` and `control_deweathered.parquet`.
193
+
194
+ ### `data/jlm_deweathered.parquet` and `data/control_deweathered.parquet` — meteorology-controlled series
195
+
196
+ Per-station, per-pollutant, per-hour pollutant series after Random Forest meteorological normalisation following the openair `deweather::buildMod` workflow. Each row contains:
197
+
198
+ | column | description |
199
+ |---|---|
200
+ | `station_id` (or `location_id`+`city` for controls) | Station |
201
+ | `timestamp_utc` | UTC hour |
202
+ | `pollutant_en` (or `pollutant`) | Pollutant |
203
+ | `value_raw` | Raw hourly mean concentration (same units as original) |
204
+ | `value_dw` | Deweathered concentration: `raw − RF_predicted + mean(raw)` |
205
+ | `units` | Native units |
206
+ | (Jerusalem only) | `is_shabbat`, `is_yom_tov`, `is_yom_kippur`, `segment`, `dow`, `hour` |
207
+
208
+ **Method.** A Random Forest is fit per pollutant per city, regressing hourly concentration on weather covariates (T, RH, wind speed, wind direction sin/cos, pressure, BLH, precipitation), seasonal day-of-year (sin/cos), and station ID. Hour-of-day and day-of-week are deliberately **excluded** from the feature set — they would let the model absorb the diurnal traffic cycle and the Shabbat / weekend effect along with weather, eliminating the very signal the analysis is trying to measure. Day-of-year stays in to capture seasonal trend (winter heating, summer photochemistry).
209
+
210
+ Subtracting the model's prediction from the raw value gives a residualised series whose Shabbat-vs-weekday contrast is attributable to *non-meteorological* factors. R² typically 0.7–0.95 depending on pollutant.
211
+
212
+ ### `data/deweathered_comparison.csv` — summary
213
+
214
+ Headline weather-controlled Shabbat % drops, Jerusalem only:
215
+
216
+ | Pollutant | Raw drop | After weather control |
217
+ |---|---:|---:|
218
+ | NO | −80% | **−52%** |
219
+ | NOx | −69% | **−43%** |
220
+ | NO₂ | −59% | **−34%** |
221
+ | Toluene | −52% | **−17%** |
222
+ | PM10 | +11% | **−12%** *(paradox flips)* |
223
+ | Benzene | −27% | **−9%** |
224
+ | PM2.5 | +28% | **−4%** *(paradox dissolves)* |
225
+ | CO | −12% | −4% |
226
+ | O₃ | +3% | +1% |
227
+
228
+ Roughly **half the raw NO₂ drop is real**, the rest is weather. Both PM paradoxes (PM2.5 and PM10 going *up* on Shabbat) dissolve once meteorology is controlled — they were dust-event artefacts, not Shabbat effects.
229
  | **Traffic-Combustion Index** | `tci`, `tci_n_inputs` | Mean of per-station z-scores (vs `segment == 'weekday'` daytime baseline) of NO₂, NO, NOx, CO, benzene, toluene. Negative = below the workweek norm. |
230
  | **Photochemical/Dust Index** | `pd_index`, `pd_n_inputs` | Mean of z-scores of O₃ + PM2.5. Moves opposite to TCI on Shabbat — captures the "wrong-way" pollutants. |
231
 
 
363
  because particulate matter dominates the index, and PM in Jerusalem is
364
  driven by long-range dust as much as by local emissions.
365
 
366
+ | Segment | EPA AQI | Canadian AQHI | TCI (z) | PD-Index (z) |
367
+ |---|---:|---:|---:|---:|
368
+ | Workweek (Sun–Thu) | 64 | 4.7 | −0.10 | −0.05 |
369
+ | Pre-Shabbat (2h) | 63 | 4.7 | −0.58 | +0.20 |
370
+ | **Shabbat** | **67** | **4.4** | **−0.61** | **+0.15** |
371
+ | Post-Havdalah (2h) | 69 | 4.5 | −0.17 | +0.06 |
372
+ | Yom Tov | 71 | 4.1 | −0.66 | +0.03 |
373
+ | **Yom Kippur** | **28** | **3.0** | **−0.90** | **−0.55** |
374
+
375
+ Both standard composite indices EPA's max-based AQI and Canada's
376
+ additive AQHI are dominated by the Jerusalem PM2.5 baseline (which is
377
+ itself dominated by long-range dust transport). EPA AQI is essentially
378
+ flat on Shabbat (64→67); AQHI moves a little (4.7→4.4) but not in
379
+ proportion to the underlying NOx drop, because PM2.5 is the largest term
380
+ in its additive sum here. The Traffic-Combustion Index plunges by half a
381
+ standard deviation on Shabbat (and almost a full standard deviation on
382
+ Yom Kippur), while the Photochemical/Dust Index drifts the other way —
383
+ exactly as the NOx-saturated urban photochemistry would predict.
384
+
385
+ **The takeaway**: standard composites are calibrated for cities where
386
+ PM2.5 sources are mostly local. In Jerusalem they become "dust meters"
387
+ that are structurally blind to traffic-emission interventions. An
388
+ activity-attributable index like TCI is the right tool for evaluating
389
+ this kind of natural experiment.
390
 
391
  ## Halachic time-window methodology
392
 
data/aqi_hourly.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:dfedcd418e4683a4d389121d822a84c5b08beda4c3a29684ed742ef1c6e974bc
3
- size 6598421
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f9631779fb4e02416c9717187551ba04d7329ba47ac7d987559e7367264cb2f9
3
+ size 8104757
data/control_deweathered.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2824ee0831aa45cf321acb2f2d46c39b3580412361e15720914c2998bf62b89e
3
+ size 2311203
data/deweathered_comparison.csv ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ pollutant,workweek_raw,shabbat_raw,raw_pct,workweek_dw,shabbat_dw,dw_pct,weather_attributable_pct
2
+ Nitric oxide,15.702728859787744,3.069718305935232,-80.45105195825991,13.01647024334683,6.294717588494071,-51.64036431680456,-28.810687641455353
3
+ Nitrogen oxides,33.34540229810552,10.284757767390909,-69.15689402861027,28.712040176873163,16.386885505062835,-42.92678122447716,-26.230112804133107
4
+ Nitrogen dioxide,17.642979009655477,7.221034317866917,-59.071343258329215,15.603294267067197,10.306261842825483,-33.948167185578214,-25.123176072751
5
+ Toluene,0.7030444134028008,0.33700427707814073,-52.065008887986394,0.8319409282589483,0.6884930441734608,-17.242556437953994,-34.8224524500324
6
+ Coarse particulates (PM10),79.4592710731101,87.9574885356914,10.695060938530542,74.75159867557039,65.56675709236892,-12.287150704381089,22.98221164291163
7
+ Benzene,0.25050041410757096,0.18362362430272877,-26.69727714546758,0.2538309426816927,0.23170964903449814,-8.714971237740288,-17.982305907727294
8
+ Fine particulates (PM2.5),20.296898359935188,25.954898680684398,27.876181968362967,20.299371467673303,19.41723430710662,-4.345637804458546,32.22181977282151
9
+ Carbon monoxide,0.5336974493102828,0.47130304095248743,-11.690969937823393,0.5452965499280292,0.5218231715427702,-4.304699596642802,-7.386270341180591
10
+ Ozone,48.71119061434654,50.398976426799,3.464883102149785,47.04943219020973,47.709629364416195,1.4031990259466776,2.0616840762031075
data/jlm_deweathered.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fec7032519567a8f9f0c286a95fb7d47b4f7c65c526d263c2b8659df76d05140
3
+ size 6626154
data/weather_hourly.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:efd2b208ef1486b2eff972f3adba0ad7f3ec7ec34e9dab1d0df5af89514f2111
3
+ size 313357
figures/15_deweathered_shabbat_effect.png ADDED

Git LFS Details

  • SHA256: 991540ec9b556140c0e7b8e2524db49f28afb3c7f1eb5e3dc399505073b79022
  • Pointer size: 130 Bytes
  • Size of remote file: 99.8 kB
figures/16_deweathered_cross_city.png ADDED

Git LFS Details

  • SHA256: 41741b853405b742ac4910d8cc3a003321aa2a9050063358d9fe8fe10b2ced3a
  • Pointer size: 130 Bytes
  • Size of remote file: 61.1 kB