Skip to content

Commit

Permalink
costa rica
Browse files Browse the repository at this point in the history
  • Loading branch information
russbiggs committed Oct 8, 2024
1 parent 111f35d commit 6a092d3
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Contributors must adhere to the OpenAQ [Code of Conduct](https://github.com/open

## Licensing

All contributions to this project will be licensed under the Creative Commons Attribution-ShareAlike (CC BY-SA) license. By submitting your work, you agree that your contributions will be freely available for others to use, modify, and share, as long as they attribute you and share any derivative works under the same license. This ensures that the project and any adaptations remain open and accessible to the community.
All contributions to this project will be licensed under the Creative Commons Attribution-ShareAlike (CC BY-SA 4.0) license. By submitting your work, you agree that your contributions will be freely available for others to use, modify, and share, as long as they attribute you and share any derivative works under the same license. This ensures that the project and any adaptations remain open and accessible to the community.

## Style guide

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Contributions are welcome! See the [CONTRIBUTING.md](./CONTRIBUTING.md) guide fo

The source code for the repository is licensed under an MIT license, found at [LICENSE](./LICENSE).

All content (markdown files) in the docs directory is licensed CC BY SA, found at [LICENSE-content](./LICENSE-content).
All content (markdown files) in the docs directory is licensed CC BY-SA 4.0, found at [LICENSE-content](./LICENSE-content).
31 changes: 31 additions & 0 deletions docs/data/costa-rica/breakpoints.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
ISO,variant,category,hex,category_lower,category_upper,pollutant,units,averaging_period,concentration_lower,concentration_upper
CR,,Good,#02af4f,0,20,PM2.5,ug/m3,24,0,15
CR,,Good,#02af4f,0,20,PM10,ug/m3,24,0,60
CR,,Good,#02af4f,0,20,O3,ppm,8,0,0.055
CR,,Good,#02af4f,0,20,NO2,ppm,1,0,0.105
CR,,Good,#02af4f,0,20,SO2,ppm,24,0,0.065
CR,,Good,#02af4f,0,20,CO,ppm,8,0,5.5
CR,,Unfavorable for sensitive groups,#ffff00,21,40,PM2.5,ug/m3,24,15.1,40
CR,,Unfavorable for sensitive groups,#ffff00,21,40,PM10,ug/m3,24,61,100
CR,,Unfavorable for sensitive groups,#ffff00,21,40,O3,ppm,8,0.056,0.11
CR,,Unfavorable for sensitive groups,#ffff00,21,40,NO2,ppm,1,0.106,0.21
CR,,Unfavorable for sensitive groups,#ffff00,21,40,SO2,ppm,24,0.066,0.13
CR,,Unfavorable for sensitive groups,#ffff00,21,40,CO,ppm,8,5.51,11
CR,,Unhealthy,#ffa500,41,60,PM2.5,ug/m3,24,40.1,65
CR,,Unhealthy,#ffa500,41,60,PM10,ug/m3,24,101,200
CR,,Unhealthy,#ffa500,41,60,O3,ppm,8,0.111,0.165
CR,,Unhealthy,#ffa500,41,60,NO2,ppm,1,0.211,0.315
CR,,Unhealthy,#ffa500,41,60,SO2,ppm,24,0.131,0.195
CR,,Unhealthy,#ffa500,41,60,CO,ppm,8,11.01,16.5
CR,,Very Unhealthy,#ff0000,61,80,PM2.5,ug/m3,24,66,100
CR,,Very Unhealthy,#ff0000,61,80,PM10,ug/m3,24,201,250
CR,,Very Unhealthy,#ff0000,61,80,O3,ppm,8,0.166,0.22
CR,,Very Unhealthy,#ff0000,61,80,NO2,ppm,1,0.316,0.42
CR,,Very Unhealthy,#ff0000,61,80,SO2,ppm,24,0.196,0.26
CR,,Very Unhealthy,#ff0000,61,80,CO,ppm,8,16.51,22
CR,,Hazardous,#800080,81,100,PM2.5,ug/m3,24,101,
CR,,Hazardous,#800080,81,100,PM10,ug/m3,24,251,
CR,,Hazardous,#800080,81,100,O3,ppm,8,0.221,
CR,,Hazardous,#800080,81,100,NO2,ppm,1,0.421,
CR,,Hazardous,#800080,81,100,SO2,ppm,24,0.261,
CR,,Hazardous,#800080,81,100,CO,ppm,8,22.1,
73 changes: 73 additions & 0 deletions docs/indices/costa-rica.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Costa Rica

## Índice Costarricense de Calidad del Aire (ICCA)

## Background

```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/costa-rica/breakpoints.csv'
).text();
const data = parseBreakpointsCsv(breakpoints);
```

The Índice Costarricense de Calidad del Aire (ICCA) accounts for pollutant
concentrations of PM<sub>2.5</sub>, PM<sub>10</sub>, O<sub>3</sub>,
SO<sub>2</sub> and NO<sub>2</sub>. The ICCA was established into Costa Rica law with the *Reglamento de Calidad del Aire para Contaminantes Criterio N° 39951-S*[^1] in 2016.

## Color scale

The ICCA uses a five-level color scale, and numerical ranges, ranging from 0 to
100, for each category:



```js
colorScale(colorScaleReshape(data))
```

_Note_: Adapted from https://elmundo.cr/costa-rica/ministerio-de-salud-anuncia-creacion-de-red-nacional-de-monitoreo-de-la-calidad-del-aire/

## Methods

```js
breakpointsTable(data)
```

Based on the breakpoint values in the table above a piecewise linear function is used to convert the concentration values to ICCA values. The function is defined as:

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

```js
piecewiseLatexDoc('ICCA')
```

The ICCA does not provide specific requirements for temporal coverage, the minimum number of valid data points required within the averaging period, for 8-hour and 24-hour measurement periods.

The ICCA uses sub-indices assigned to each of the measured pollutants. The highest sub-index determines the overall ICCA of the station.

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

## References

Ministerio de Salud anuncia creación de Red Nacional de Monitoreo de la Calidad
del Aire, November 2, 2016,
<https://elmundo.cr/costa-rica/ministerio-de-salud-anuncia-creacion-de-red-nacional-de-monitoreo-de-la-calidad-del-aire/>

Reglamento de Calidad del Aire para Contaminantes Criterio, August 9 2016,
<http://www.pgrweb.go.cr/scij/Busqueda/Normativa/Normas/nrm_texto_completo.aspx?param1=NRTC&nValor1=1&nValor2=82827&nValor3=106098&strTipM=TC/>

[^1]:
<http://www.pgrweb.go.cr/scij/Busqueda/Normativa/Normas/nrm_texto_completo.aspx?param1=NRTC&nValor1=1&nValor2=82827&nValor3=106098&strTipM=TC>
2 changes: 1 addition & 1 deletion docs/indices/kuwait.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ _Note_: Adapted from "Air Quality Status" (n.d.), <https://enterprise.emisk.org/

## Methods

The KAQI uses a sub-index method, wherein an index value is calculated for each of the measured pollutants, then the final KAQI value is chosen from the highest sub-index value of all pollutants evaluated.
The KAQI uses a sub-index method, wherein an index value is calculated for each of the measured pollutants, then the final KAQI value is chosen from the highest sub-index value of all pollutants evaluated.

```js
breakpointsTable(data)
Expand Down
3 changes: 2 additions & 1 deletion observablehq.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default {
{name: "Australia", path: "/indices/australia"},
{name: "Canada", path: "/indices/canada"},
{name: "China", path: "/indices/china"},
{name: "Costa Rica", path: "/indices/costa-rica"},
{name: "European Union", path:"/indices/eu"},
{name: "Finland", path:"/indices/finland"},
{name: "Hong Kong", path: "/indices/hong-kong"},
Expand All @@ -56,7 +57,7 @@ export default {
// Some additional configuration options and their defaults:
theme: "light", // try "light", "dark", "slate", etc.
header: '<h1 class="gradient-title">Air Quality Index Hub</h1>', // what to show in the header (HTML)
footer: '<div>Developed by <a href="https://openaq.org">OpenAQ</a>. Are we missing an AQI? Did you spot a bug? <a href="https://github.com/openaq/aqi-hub">contribute on github</a></div><div>Content licensed <a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA</a></div>', // what to show in the footer (HTML)
footer: '<div>Developed by <a href="https://openaq.org">OpenAQ</a>. Are we missing an AQI? Did you spot a bug? <a href="https://github.com/openaq/aqi-hub">contribute on github</a></div><div>Content licensed <a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div>', // what to show in the footer (HTML)
toc: true, // whether to show the table of contents
pager: true, // whether to show previous & next links in the footer
style: "style.css",
Expand Down

0 comments on commit 6a092d3

Please sign in to comment.