Skip to content

Commit

Permalink
add israel (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
russbiggs authored Nov 15, 2024
1 parent afbeee9 commit bfcd539
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/components/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import {html} from "npm:htl";

import { tableReshape, normalizePollutantLabel, normalizeUnitsLabel } from '../utils/utils.js';

export function breakpointsTable(data, range=true) {
export function breakpointsTable(data, range=true, label=true) {

const headerColumns = data.map((i) => html`<th>${i.category}<br/>${i.categoryLower}${i.categoryUpper ? `-${i.categoryUpper}`: range ? '+': ''}</th>`)
const headerColumns = data.map((i) => html`<th>${label ? i.category: ''}<br/>${i.categoryLower}${i.categoryUpper ? `-${i.categoryUpper}`: range ? '+': ''}</th>`)


return html`<table>
Expand Down
43 changes: 43 additions & 0 deletions docs/data/israel/breakpoints.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
ISO,variant,category,hex,category_lower,category_upper,pollutant,units,averaging_period,concentration_lower,concentration_upper
IL,,g,a,0,49,PM2.5,ug/m3,24,0,18.5
IL,,g,a,0,49,PM10,ug/m3,24,0,65
IL,,g,a,0,49,SO2,ppb,1,0,67
IL,,g,a,0,49,NO2,ppb,1,0,53
IL,,g,a,0,49,O3,ppb,8,0,35
IL,,g,a,0,49,CO,ppb,0.5,0,26
IL,,g,a,0,49,NOX,ppb,0.5,0,250
IL,,h,b,50,100,PM2.5,ug/m3,24,18.6,37
IL,,h,b,50,100,PM10,ug/m3,24,66,129
IL,,h,b,50,100,SO2,ppb,1,68,133
IL,,h,b,50,100,NO2,ppb,1,54,105
IL,,h,b,50,100,O3,ppb,8,36,70
IL,,h,b,50,100,CO,ppb,0.5,27,51
IL,,h,b,50,100,NOX,ppb,0.5,251,499
IL,,i,c,101,200,PM2.5,ug/m3,24,37.5,84
IL,,i,c,101,200,PM10,ug/m3,24,130,215
IL,,i,c,101,200,SO2,ppb,1,134,163
IL,,i,c,101,200,NO2,ppb,1,106,160
IL,,i,c,101,200,O3,ppb,8,71,97
IL,,i,c,101,200,CO,ppb,0.5,52,78
IL,,i,c,101,200,NOX,ppb,0.5,500,750
IL,,j,d,201,300,PM2.5,ug/m3,24,84.5,130
IL,,j,d,201,300,PM10,ug/m3,24,216,300
IL,,j,d,201,300,SO2,ppb,1,164,191
IL,,j,d,201,300,NO2,ppb,1,161,213
IL,,j,d,201,300,O3,ppb,8,98,117
IL,,j,d,201,300,CO,ppb,0.5,79,104
IL,,j,d,201,300,NOX,ppb,0.5,751,1000
IL,,k,e,301,400,PM2.5,ug/m3,24,130.5,165
IL,,k,e,301,400,PM10,ug/m3,24,301,355
IL,,k,e,301,400,SO2,ppb,1,192,253
IL,,k,e,301,400,NO2,ppb,1,214,260
IL,,k,e,301,400,O3,ppb,8,118,155
IL,,k,e,301,400,CO,ppb,0.5,105,130
IL,,k,e,301,400,NOX,ppb,0.5,1001,1200
IL,,l,f,401,500,PM2.5,ug/m3,24,165.5,200
IL,,l,f,401,500,PM10,ug/m3,24,356,430
IL,,l,f,401,500,SO2,ppb,1,254,303
IL,,l,f,401,500,NO2,ppb,1,261,316
IL,,l,f,401,500,O3,ppb,8,15,188
IL,,l,f,401,500,CO,ppb,0.5,131,156
IL,,l,f,401,500,NOX,ppb,0.5,1201,1400
4 changes: 4 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ const countriesMap = await FileAttachment('./data/countries.json').json();
let pm2524hr = breakpoints.filter(o => o.pollutant == 'PM2.5' && o.averaging_period == '24');
pm2524hr = pm2524hr.map(o => { o.concentration_upper ? o.concentration_upper : o.concentration_upper = 500; return o})
pm2524hr = pm2524hr.map(o => { o.country = countriesMap[o.ISO]; return o})
pm2524hr = pm2524hr.filter(o => o.ISO !== 'IL')
```

```js
pm2524hr
```

```js
Expand Down
64 changes: 64 additions & 0 deletions docs/indices/israel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

# Israel

## Air Quality Index (AQI)

```js
import {breakpointsTable} from "../components/table.js";
import { parseBreakpointsCsv, tableReshape, colorScaleReshape } from '../utils/utils.js';
import { colorScale } from '../components/color-scale.js';
const breakpoints = await FileAttachment('../data/israel/breakpoints.csv').text();
const data = parseBreakpointsCsv(breakpoints);
```

## Background

The Israel Air Quality Index (AQI) was developed by the Ministry of Environmental Protection. Seven criteria pollutants, PM<sub>2.5</sub>, PM<sub>10</sub>, CO, O<sub>3</sub>, SO<sub>2</sub>, NO<sub>2</sub>, and NO<sub>x</sub>, are covered in the methodology.

## Color scale

The Israel AQI is represented with a diverging scale composed of 4 value bands ranging from -400 to 100, with a distinct color for each band.

```js
colorScale([{color: '#984806', label: 'Very low', range: '−201–−400'},{color: '#ff0000', label: 'Low', range: '−1–−200'},{color: '#ffff00', label: 'Medium', range: '0–50'}, {color: '#04ff00', label: 'Good', range: '51–100'}])
```

_Note_: Adapted from "חישוב מדד איכות האוויר" [https://air.sviva.gov.il/Pagesfiles/החישוב שלמדדזיהוםהאוויר AQIלאתרהחדש.pdf](https://air.sviva.gov.il/Pagesfiles/%D7%94%D7%97%D7%99%D7%A9%D7%95%D7%91%20%D7%A9%D7%9C%20%D7%9E%D7%93%D7%93%20%D7%96%D7%99%D7%94%D7%95%D7%9D%20%D7%94%D7%90%D7%95%D7%95%D7%99%D7%A8%20AQI%20%D7%9C%D7%90%D7%AA%D7%A8%20%D7%94%D7%97%D7%93%D7%A9.pdf). Accessed November 12, 2024.

## Methods

The Israel AQI uses a sub-index method where each pollutant is calculated against pollutant-specific breakpoints into a pollutant sub-index value. All pollutants are then compared and the largest sub-index value determines the full composite AQI value. The Ministry of Environmental Protection provides no specific guidance provided on the minimum number of pollutants required to compute a full composite index.

Pollutant breakpoints are defined in the table below:

```js
breakpointsTable(data, true, false)
```

_Note_: Adapted from "חישוב מדד איכות האוויר" [https://air.sviva.gov.il/Pagesfiles/החישוב שלמדדזיהוםהאוויר AQIלאתרהחדש.pdf](https://air.sviva.gov.il/Pagesfiles/%D7%94%D7%97%D7%99%D7%A9%D7%95%D7%91%20%D7%A9%D7%9C%20%D7%9E%D7%93%D7%93%20%D7%96%D7%99%D7%94%D7%95%D7%9D%20%D7%94%D7%90%D7%95%D7%95%D7%99%D7%A8%20AQI%20%D7%9C%D7%90%D7%AA%D7%A8%20%D7%94%D7%97%D7%93%D7%A9.pdf). Accessed November 12, 2024.

Using the breakpoint values in the table above, a [piecewise linear function](/methods#piecewise-linear-function) is used to convert the concentration values to AQI values. The piecewise linear function is defined as:

```js
import {piecewiseLatexDoc} from '../components/piecewise.js';
```

```js
piecewiseLatexDoc('AQI')
```

After computing the AQI value for each measuremed pollutant, the maximum pollutant value it taken as the prevailing value.

```tex
{AQI{^\prime}} = {Max}({I}_{PM_{2.5}},{I}_{PM_{10}},{I}_{CO},{I}_{O_{3}},{I}_{SO_{2}},{I}_{NO_{2}},{I}_{NO_{x}})
```

The final Israel AQI value is then derived by substracting the previous AQI value from 100.

```tex
AQI = 100 - AQI{^\prime}
```

## References

ניטור אוויר בישראל המשרד להגנת הסביבה (n.d) [https://air.sviva.gov.il/](https://air.sviva.gov.il/). Accessed November 12 2024.
2 changes: 1 addition & 1 deletion docs/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const breakpoints = await FileAttachment('./data/breakpoints.csv').csv({typed: t
const countriesMap = await FileAttachment('./data/countries.json').json();
let pm2524hr = breakpoints.filter(o => o.pollutant == 'PM2.5' && o.averaging_period == '24');
pm2524hr = pm2524hr.map(o => { o.concentration_upper ? o.concentration_upper : o.concentration_upper = 500; return o})
pm2524hr = pm2524hr.filter(o => ['PE', 'MX', 'GB'].indexOf(o.ISO) < 0) // Peru, UK and Mexico have a 24 hr average but do not use the piecewise
pm2524hr = pm2524hr.filter(o => ['PE', 'MX', 'GB', 'IL', 'EU'].indexOf(o.ISO) < 0) // Peru, UK and Mexico have a 24 hr average but do not use the piecewise
```

```js
Expand Down
2 changes: 2 additions & 0 deletions docs/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ export function normalizePollutantLabel(value) {
return html`O<sub>3</sub>`
case 'NO2':
return html`NO<sub>2</sub>`
case 'NOX':
return html`NO<sub>x</sub>`
case 'SO2':
return html`SO<sub>2</sub>`
default:
Expand Down
1 change: 1 addition & 0 deletions observablehq.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default {
{name: "Hong Kong", path: "/indices/hong-kong"},
{name: "India", path: "/indices/india"},
{name: "Indonesia", path: "/indices/indonesia"},
{name: "Israel", path: "/indices/israel"},
{name: "Kuwait", path: "/indices/kuwait"},
{name: "Macao", path: "/indices/macao"},
{name: "Malaysia", path: "/indices/malaysia"},
Expand Down

0 comments on commit bfcd539

Please sign in to comment.