From 6a092d327defeddd6a405eeb3200df42feb772d8 Mon Sep 17 00:00:00 2001 From: Russ Biggs Date: Mon, 7 Oct 2024 20:53:07 -0600 Subject: [PATCH] costa rica --- CONTRIBUTING.md | 2 +- README.md | 2 +- docs/data/costa-rica/breakpoints.csv | 31 ++++++++++++ docs/indices/costa-rica.md | 73 ++++++++++++++++++++++++++++ docs/indices/kuwait.md | 2 +- observablehq.config.js | 3 +- 6 files changed, 109 insertions(+), 4 deletions(-) create mode 100644 docs/data/costa-rica/breakpoints.csv create mode 100644 docs/indices/costa-rica.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e712c55..b26c521 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 diff --git a/README.md b/README.md index 741ee4c..f1e68b6 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/docs/data/costa-rica/breakpoints.csv b/docs/data/costa-rica/breakpoints.csv new file mode 100644 index 0000000..6138530 --- /dev/null +++ b/docs/data/costa-rica/breakpoints.csv @@ -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, \ No newline at end of file diff --git a/docs/indices/costa-rica.md b/docs/indices/costa-rica.md new file mode 100644 index 0000000..9ad6817 --- /dev/null +++ b/docs/indices/costa-rica.md @@ -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 PM2.5, PM10, O3, +SO2 and NO2. 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, + + +Reglamento de Calidad del Aire para Contaminantes Criterio, August 9 2016, + + +[^1]: + diff --git a/docs/indices/kuwait.md b/docs/indices/kuwait.md index 16b26ea..f5ea865 100644 --- a/docs/indices/kuwait.md +++ b/docs/indices/kuwait.md @@ -30,7 +30,7 @@ _Note_: Adapted from "Air Quality Status" (n.d.), Air Quality Index Hub', // what to show in the header (HTML) - footer: '
Developed by OpenAQ. Are we missing an AQI? Did you spot a bug? contribute on github
Content licensed CC BY-SA
', // what to show in the footer (HTML) + footer: '
Developed by OpenAQ. Are we missing an AQI? Did you spot a bug? contribute on github
Content licensed CC BY-SA 4.0
', // 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",