diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2020-03-10 12:27:53 +0000 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2020-03-10 12:27:53 +0000 |
| commit | 7c6c2e09e3ad1d41f26869cb7b9f9882175c8a6e (patch) | |
| tree | 10aa6710599230c889ec44407a065ee303a79348 /datasets/ozone | |
| download | TCPD-7c6c2e09e3ad1d41f26869cb7b9f9882175c8a6e.tar.gz TCPD-7c6c2e09e3ad1d41f26869cb7b9f9882175c8a6e.zip | |
Initial commit
Diffstat (limited to 'datasets/ozone')
| -rw-r--r-- | datasets/ozone/.gitignore | 1 | ||||
| -rw-r--r-- | datasets/ozone/README.md | 29 | ||||
| -rw-r--r-- | datasets/ozone/convert.py | 63 | ||||
| -rw-r--r-- | datasets/ozone/ozone-depleting-substance-emissions.csv | 109 | ||||
| -rw-r--r-- | datasets/ozone/ozone.json | 184 | ||||
| -rw-r--r-- | datasets/ozone/ozone.png | bin | 0 -> 17845 bytes |
6 files changed, 386 insertions, 0 deletions
diff --git a/datasets/ozone/.gitignore b/datasets/ozone/.gitignore new file mode 100644 index 0000000..a52cbb0 --- /dev/null +++ b/datasets/ozone/.gitignore @@ -0,0 +1 @@ +old/ diff --git a/datasets/ozone/README.md b/datasets/ozone/README.md new file mode 100644 index 0000000..ca2b6c2 --- /dev/null +++ b/datasets/ozone/README.md @@ -0,0 +1,29 @@ +# Ozone-depleting substance emissions + +This dataset contains "Global emissions of ozone-depleting substances, +measured in tonnes of chlorofluorocarbon-11 equivalents +(CFC11-equivalents) per year." It is obtained from [Our World in +Data](https://ourworldindata.org/ozone-layer), who have scraped the data from: + +Hegglin, M. I., Fahey, D. W., McFarland, M., Montzka, S. A., & Nash, E. R. +(2014). [Twenty questions and answers about the ozone layer: 2014 +update](https://www.wmo.int/pages/prog/arep/gaw/ozone_2014/documents/2014%20Twenty%20Questions_Final.pdf). +World Meteorological Organization, UNEP, NOAA, NASA, and European Commission. + +A change is expected after the signing of the [Montreal +Protocol](https://en.wikipedia.org/wiki/Montreal_Protocol). + +The chart in the article by [Our World in +Data](https://ourworldindata.org/ozone-layer) is licensed under [CC BY +4.0](https://creativecommons.org/licenses/by/4.0/deed.en_US). No changes to +the data were made. The original data sourced from Hegglin et al., 2015 (cited +above) is in the public domain. + +The ``ozone.json`` file can be obtained from the original +``./ozone-depleting-substance-emissions.csv`` by running: + +``` +$ python convert.py ./ozone-depleting-substance-emissions.csv ./ozone.json +``` + + diff --git a/datasets/ozone/convert.py b/datasets/ozone/convert.py new file mode 100644 index 0000000..4c5aefd --- /dev/null +++ b/datasets/ozone/convert.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +Dataset conversion script + +Author: G.J.J. van den Burg + +""" + +import argparse +import clevercsv +import json + + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument("input_file", help="File to convert") + parser.add_argument("output_file", help="File to write to") + return parser.parse_args() + + +def main(): + args = parse_args() + + with open(args.input_file, "r", newline="", encoding="ascii") as fp: + reader = clevercsv.reader( + fp, delimiter=",", quotechar="", escapechar="" + ) + rows = list(reader) + + header = rows.pop(0) + + total = [r for r in rows if r[0] == "Total emissions"] + time = [r[2] for r in total] + values = [int(r[-1]) for r in total] + + name = "ozone" + longname = "Ozone-Depleting Emissions" + time_fmt = "%Y" + + series = [{"label": "Total Emissions", "type": "int", "raw": values}] + + data = { + "name": name, + "longname": longname, + "n_obs": len(time), + "n_dim": len(series), + "time": { + "type": "string", + "format": time_fmt, + "index": list(range(len(time))), + "raw": time, + }, + "series": series, + } + + with open(args.output_file, "w") as fp: + json.dump(data, fp, indent="\t") + + +if __name__ == "__main__": + main() diff --git a/datasets/ozone/ozone-depleting-substance-emissions.csv b/datasets/ozone/ozone-depleting-substance-emissions.csv new file mode 100644 index 0000000..a8b0af6 --- /dev/null +++ b/datasets/ozone/ozone-depleting-substance-emissions.csv @@ -0,0 +1,109 @@ +Entity,Code,Year,Ozone-depleting substance emissions (Scientific Assessment 2014) (tonnes CFC11-equivalents) +Natural emissions,,1961,165000 +Natural emissions,,1962,165000 +Natural emissions,,1963,165000 +Natural emissions,,1964,165000 +Natural emissions,,1965,165000 +Natural emissions,,1966,165000 +Natural emissions,,1967,165000 +Natural emissions,,1968,165000 +Natural emissions,,1969,165000 +Natural emissions,,1970,165000 +Natural emissions,,1971,165000 +Natural emissions,,1972,165000 +Natural emissions,,1973,165000 +Natural emissions,,1974,165000 +Natural emissions,,1975,165000 +Natural emissions,,1976,165000 +Natural emissions,,1977,165000 +Natural emissions,,1978,165000 +Natural emissions,,1979,165000 +Natural emissions,,1980,165000 +Natural emissions,,1981,165000 +Natural emissions,,1982,165000 +Natural emissions,,1983,165000 +Natural emissions,,1984,165000 +Natural emissions,,1985,165000 +Natural emissions,,1986,165000 +Natural emissions,,1987,165000 +Natural emissions,,1988,165000 +Natural emissions,,1989,165000 +Natural emissions,,1990,165000 +Natural emissions,,1991,165000 +Natural emissions,,1992,165000 +Natural emissions,,1993,165000 +Natural emissions,,1994,165000 +Natural emissions,,1995,165000 +Natural emissions,,1996,165000 +Natural emissions,,1997,165000 +Natural emissions,,1998,165000 +Natural emissions,,1999,165000 +Natural emissions,,2000,165000 +Natural emissions,,2001,165000 +Natural emissions,,2002,165000 +Natural emissions,,2003,165000 +Natural emissions,,2004,165000 +Natural emissions,,2005,165000 +Natural emissions,,2006,165000 +Natural emissions,,2007,165000 +Natural emissions,,2008,165000 +Natural emissions,,2009,165000 +Natural emissions,,2010,165000 +Natural emissions,,2011,165000 +Natural emissions,,2012,165000 +Natural emissions,,2013,165000 +Natural emissions,,2014,165000 +Total emissions,,1961,380000 +Total emissions,,1962,400000 +Total emissions,,1963,440000 +Total emissions,,1964,480000 +Total emissions,,1965,510000 +Total emissions,,1966,540000 +Total emissions,,1967,580000 +Total emissions,,1968,630000 +Total emissions,,1969,660000 +Total emissions,,1970,720000 +Total emissions,,1971,770000 +Total emissions,,1972,840000 +Total emissions,,1973,910000 +Total emissions,,1974,980000 +Total emissions,,1975,1040000 +Total emissions,,1976,1050000 +Total emissions,,1977,1070000 +Total emissions,,1978,1070000 +Total emissions,,1979,1110000 +Total emissions,,1980,1080000 +Total emissions,,1981,1040000 +Total emissions,,1982,1100000 +Total emissions,,1983,1090000 +Total emissions,,1984,1150000 +Total emissions,,1985,1180000 +Total emissions,,1986,1280000 +Total emissions,,1987,1360000 +Total emissions,,1988,1460000 +Total emissions,,1989,1410000 +Total emissions,,1990,1320000 +Total emissions,,1991,1190000 +Total emissions,,1992,1080000 +Total emissions,,1993,960000 +Total emissions,,1994,820000 +Total emissions,,1995,760000 +Total emissions,,1996,700000 +Total emissions,,1997,640000 +Total emissions,,1998,600000 +Total emissions,,1999,590000 +Total emissions,,2000,560000 +Total emissions,,2001,530000 +Total emissions,,2002,490000 +Total emissions,,2003,480000 +Total emissions,,2004,470000 +Total emissions,,2005,450000 +Total emissions,,2006,430000 +Total emissions,,2007,410000 +Total emissions,,2008,400000 +Total emissions,,2009,390000 +Total emissions,,2010,380000 +Total emissions,,2011,370000 +Total emissions,,2012,350000 +Total emissions,,2013,340000 +Total emissions,,2014,320000
\ No newline at end of file diff --git a/datasets/ozone/ozone.json b/datasets/ozone/ozone.json new file mode 100644 index 0000000..2f09d96 --- /dev/null +++ b/datasets/ozone/ozone.json @@ -0,0 +1,184 @@ +{ + "name": "ozone", + "longname": "Ozone-Depleting Emissions", + "n_obs": 54, + "n_dim": 1, + "time": { + "type": "string", + "format": "%Y", + "index": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53 + ], + "raw": [ + "1961", + "1962", + "1963", + "1964", + "1965", + "1966", + "1967", + "1968", + "1969", + "1970", + "1971", + "1972", + "1973", + "1974", + "1975", + "1976", + "1977", + "1978", + "1979", + "1980", + "1981", + "1982", + "1983", + "1984", + "1985", + "1986", + "1987", + "1988", + "1989", + "1990", + "1991", + "1992", + "1993", + "1994", + "1995", + "1996", + "1997", + "1998", + "1999", + "2000", + "2001", + "2002", + "2003", + "2004", + "2005", + "2006", + "2007", + "2008", + "2009", + "2010", + "2011", + "2012", + "2013", + "2014" + ] + }, + "series": [ + { + "label": "Total Emissions", + "type": "int", + "raw": [ + 380000, + 400000, + 440000, + 480000, + 510000, + 540000, + 580000, + 630000, + 660000, + 720000, + 770000, + 840000, + 910000, + 980000, + 1040000, + 1050000, + 1070000, + 1070000, + 1110000, + 1080000, + 1040000, + 1100000, + 1090000, + 1150000, + 1180000, + 1280000, + 1360000, + 1460000, + 1410000, + 1320000, + 1190000, + 1080000, + 960000, + 820000, + 760000, + 700000, + 640000, + 600000, + 590000, + 560000, + 530000, + 490000, + 480000, + 470000, + 450000, + 430000, + 410000, + 400000, + 390000, + 380000, + 370000, + 350000, + 340000, + 320000 + ] + } + ] +}
\ No newline at end of file diff --git a/datasets/ozone/ozone.png b/datasets/ozone/ozone.png Binary files differnew file mode 100644 index 0000000..37b4e89 --- /dev/null +++ b/datasets/ozone/ozone.png |
