Contents: Important links & notes — Running the code — CLI --help text — History — References
This code generates plots used in figures in Chapter 10, mainly Section 10.7, titled “Scenarios from integrated, sectoral, and regional models”. The code does not generate other Chapter 10 plots or figures not mentioned.
The code, including its entire edit history, is available on GitHub at: https://github.com/transportenergy/ipcc-ar6-wg3-ch10
Each plot responds to multiple configuration options; thus, there are at least 30 variants of each plot, many with multiple pages (one per spatial region).
The figures in the final text of Chapter 10 each contain 1 or more pages from 1 or 2 variants of each plot, selected to best support the assessment text. The commands which will generate the specific plots used in the figures are:
- Figure 10.14:
fig_9
, created using:python -m ar6_wg3_ch10 plot --ar6-data=world --bw10 9
- Figure 10.17:
fig_10
, created using:python -m ar6_wg3_ch10 plot --ar6-data=world --bw10 9
(IAM scenarios; i.e. same as Figure 10.14, but a different page)python -m ar6_wg3_ch10 plot --tem-data=IMO --bw=8 10
(IMO scenarios)
- Figure 10.18:
fig_1
, created using:python -m ar6_wg3_ch10 plot --ar6-data=world --bw=9 1
(world panel)python -m ar6_wg3_ch10 plot --ar6-data=R6 --bw=9 1
(regional panels)
- Figure 10.19:
fig_2
, created using:python -m ar6_wg3_ch10 plot --ar6-data=world --bw=9 2
(world panel)python -m ar6_wg3_ch10 plot --ar6-data=R6 --bw=9 2
(regional panels)
- Figure 10.20:
fig_6
, created using:python -m ar6_wg3_ch10 plot --ar6-data=world --bw=8 --recat=A 6
. - Figure 10.21:
fig_4
, created using:python -m ar6_wg3_ch10 plot --ar6-data=world --bw=9 4
. - Figure 10.22:
fig_7
, created using:python -m ar6_wg3_ch10 plot --ar6-data=world --bw=9 --recat=A 7
. - Figure 10.23 (in Box 10.5):
fig_8
, created using:python -m ar6_wg3_ch10 plot --ar6-data=IP 8
.
- Figure 10.14:
Earlier versions of figures used by the chapter authors in earlier drafts of the report are uploaded on Box.com (access for report contributors only), in the
7 Scenarios/plots/
folder.- Subfolders are named by date.
- There are multiple variants of each figure, as indicated by the file name:
AR6-world
,AR6-R5
,AR6-R10
,AR6-country
—these indicate which snapshot of data from the AR6 database is used.
- Each dated folder contains a
data/
subfolder with ZIP files containing CSV dumps of the data used each plot. The file names match figure file names, with additions, e.g.:_plot.csv
: the actual values, e.g. descriptive statistics (median etc.) displayed in the plot._iam.csv
: the individual scenario values used to compute these statistics._indicator.csv
: a subset of scenario values for the Chapter 3-designated indicator scenarios._tem.csv
: data from the G-/NTEM (sectoral and national) models.
The file NOTES.rst contains some earlier plans and notes, not all up to date. Refer to the code for latest information, comments, pending ``TODO``s, etc. The files all follow a similar pattern.
For instance, for information on
fig2
, refer to the file ar6_wg3_ch10/fig_2.py.
Download the snapshots from the AR6 Scenario Explorer website.
This data is submitted by a variety of parties, and processed in various ways by the Chapter 3 team. The code here uses the metadata produced by Chapter 3 to select data to be plotted.
Place the contents in the directory
data/raw/
.Data must be converted to
.csv.gz
format, using a process like:- Unpack the
.zip
snapshot and enter the directory created. - Compress the data using the Gzip command-line program, available on most
*nix systems:
gzip *.csv
. - Move the file created to
data/raw/
.
Refer to the file
common.py
for the expected file names.- Unpack the
Install requirements:
pip install -r requirements.txt
Run
python -m ar6_wg3_ch10 plot-all
(about 30 minutes) or other commands
(see below).
To retrieve raw data from the Scenario Explorer API, modify
config-example.json
to create a file named config.json
with content
like:
{ "credentials": { "username": "your-user-name", "password": "your-password" }, "remote": { "upload": "ipcc:IPCC CH10/7 Scenarios/plots" } }
(NB. do not commit this file to the git repository; your password will become a permanent part of the history, and you will need to change it.)
# Cache all raw data $ python -m ar6_wg3_ch10 cache refresh AR6 # about 60 minutes
Note that the final process to generate figures used in the report does not use this raw data directly, but rather the post-processed "snapshots" provided by the Chapter 3 team, as mentioned above.
The top-level CLI and each command provide help text; use --help
.
For example, python -m ar6_wg3_ch10 --help
gives:
Use git log
on the command line or the “commits” tab on the GitHub website.
These are only for convenience; the chapter/section Mendeley collections should be used to store all key references.