{
“cells”: [
{

“cell_type”: “markdown”, “id”: “cell-6de0b945a6”, “metadata”: {}, “source”: [

“# TUTORIAL: Study objective B0, dynamic CC (deterministic)”

]

}, {

“cell_type”: “markdown”, “id”: “cell-a5ccf68d37”, “metadata”: {}, “source”: [

“AESA Phase B: (dynamic) carrying capacities definition.\n”, “Extract AR6 climate change pathways from process_ar6(…) outputs.”

]

}, {

“cell_type”: “markdown”, “id”: “cell-b0e62ecfec”, “metadata”: {}, “source”: [

“# Before starting…”

]

}, {

“cell_type”: “markdown”, “id”: “f6b02f42”, “metadata”: {}, “source”: [

“### Set workspace”

]

}, {

“cell_type”: “markdown”, “id”: “47c4301c”, “metadata”: {}, “source”: [

“Run set_workspace(…) before any later function call. It sets the active workspace rootn”, “for the current Python session, creates or reuses the workspace, imports packagen”, “prerequisites under data_raw/, and records setup guidance in data_raw/summary.log.”

]

}, {

“cell_type”: “code”, “execution_count”: null, “id”: “cell-7317688674”, “metadata”: {}, “outputs”: [], “source”: [

“from pyaesa import set_workspacen”, “n”, “# Windows example; update this path before running.n”, “set_workspace(r"C:\Users\username\Documents\aesa_workspace")n”, “n”, “# macOS example; update this path before running.n”, “# set_workspace("/Users/username/Documents/aesa_workspace")”

]

}, {

“cell_type”: “markdown”, “id”: “cell-3bf81de67c”, “metadata”: {}, “source”: [

“### Run prerequisitesn”, “n”, “This tutorial assumes that the workspace has already been set, with all prerequisites available (downloads and processing).\n”, “If this is not your case, it is recommended to first go through the core prerequisite notebooks: [tutorials/core_prerequisites/0_set_workspace.ipynb](../../core_prerequisites/0_set_workspace.ipynb), [tutorials/core_prerequisites/1_download_data.ipynb](../../core_prerequisites/1_download_data.ipynb), and [tutorials/core_prerequisites/2_process_data.ipynb](../../core_prerequisites/2_process_data.ipynb).”

]

}, {

“cell_type”: “markdown”, “id”: “1e640f83”, “metadata”: {}, “source”: [

“# Basic features of the deterministic function”

]

}, {

“cell_type”: “markdown”, “id”: “9e71afe0”, “metadata”: {}, “source”: [

“### In a nutshell”

]

}, {

“cell_type”: “markdown”, “id”: “fd298537”, “metadata”: {}, “source”: [

“The function takes necessary inputs:n”, “- years (must contain at least two consecutive years).n”, “- category and ssp_scenario, which restrict the retained AR6 pathway pool.n”, “- emission_type, include_afolu, and emissions_mode, which select the dynamic carrying capacity emission route.n”, “n”, “The deterministic output folder contains:n”, “- dynamic AR6 carrying capacity tables for the selected emission variable and years.n”, “- Figures are rendered by default (figures=True). Use figures=False to skip them; figure_format controls the file format and resolution.n”, “- log filesn”, “n”, “Basic features also involve:n”, “- overwriting of existing values: use the refresh parameter.n”

]

}, {

“cell_type”: “markdown”, “id”: “bddd6de6”, “metadata”: {}, “source”: [

“Methodological details on AR6 scenario filtering, harmonization, gross emissions modes, and dynamic carrying capacity construction are documented in <a href="../../methodological_notes/methodological_note_steady_state_dynamic_cc.pdf">methodological_notes/methodological_note_steady_state_dynamic_cc.pdf</a>.n”

]

}, {

“cell_type”: “markdown”, “id”: “cell-41031d03c7”, “metadata”: {}, “source”: [

“### Public argument checklistn”, “The table lists all arguments; the same definitions are available in the function docstring.n”, “n”, “<div class="pyaesa-argument-legend">n”, “<div class="pyaesa-default-block" style="color:#087f5b"><strong>Green items = default if omitted.</strong></div>n”, “<div class="pyaesa-optional-block" style="color:#c45f00"><strong>Orange items = optional feature skipped if omitted.</strong></div>n”, “</div>n”, “n”, “Do not write green or orange items when that behavior is intended.n”, “n”, “<details open>n”, “<summary><code>deterministic_ar6_cc(…)</code> arguments</summary>n”, “n”, “<table>n”, “<thead><tr><th>Argument</th><th>Description</th></tr></thead>n”, “<tbody>n”, “<tr><td style="vertical-align:top; white-space:nowrap;"><code>years</code></td><td>Study year selector provided as a consecutive year<br>&#10;list or <code>range(start_year, end_year + 1)</code>. The resolved years<br>&#10;must contain at least two consecutive years with no gaps.</td></tr>n”, “<tr class="pyaesa-default-row" style="color:#087f5b;"><td style="vertical-align:top; white-space:nowrap;"><code>harmonization</code></td><td>Whether to harmonize retained AR6 pathways to the<br>&#10;historical baseline. <strong>Defaults to</strong> <code>True</code>.</td></tr>n”, “<tr class="pyaesa-default-row" style="color:#087f5b;"><td style="vertical-align:top; white-space:nowrap;"><code>harmonization_method</code></td><td>Harmonization method applied only when<br>&#10;<code>harmonization=True</code>. <strong>Defaults to</strong> <code>&quot;offset&quot;</code>. The only<br>&#10;supported value is currently <code>&quot;offset&quot;</code>.<br>&#10;Ignored when <code>harmonization=False</code>.</td></tr>n”, “<tr class="pyaesa-default-row" style="color:#087f5b;"><td style="vertical-align:top; white-space:nowrap;"><code>category</code></td><td>AR6 category classification selector for global<br>&#10;warming trajectories. Accepts a string such as <code>&quot;C3&quot;</code> or a list such as<br>&#10;<code>[&quot;C1&quot;, &quot;C2&quot;]</code>. Valid values are <code>&quot;C1&quot;</code> through <code>&quot;C8&quot;</code>.<br>&#10;<strong>Defaults to</strong> <code>[&quot;C1&quot;, &quot;C2&quot;, &quot;C3&quot;, &quot;C4&quot;]</code>, the categories<br>&#10;aligned with the 2015 Paris Agreement.</td></tr>n”, “<tr class="pyaesa-default-row" style="color:#087f5b;"><td style="vertical-align:top; white-space:nowrap;"><code>ssp_scenario</code></td><td>SSP scenario filter. <strong>Defaults to</strong><br>&#10;<code>[&quot;SSP1&quot;, &quot;SSP2&quot;, &quot;SSP3&quot;, &quot;SSP4&quot;, &quot;SSP5&quot;]</code>. Pass a string<br>&#10;such as <code>&quot;SSP2&quot;</code> or a list such as <code>[&quot;SSP1&quot;, &quot;SSP2&quot;]</code> to<br>&#10;restrict.</td></tr>n”, “<tr class="pyaesa-default-row" style="color:#087f5b;"><td style="vertical-align:top; white-space:nowrap;"><code>emission_type</code></td><td>Dynamic AR6 emission type. Accepted values are<br>&#10;<code>&quot;kyoto_gases&quot;</code> (<strong>default</strong>) and <code>&quot;co2&quot;</code>.<br>&#10;<code>emission_type=&quot;kyoto_gases&quot;</code> uses the GWP100 Kyoto Gases<br>&#10;aggregate; <code>emission_type=&quot;co2&quot;</code> uses direct CO2 pathways.</td></tr>n”, “<tr class="pyaesa-default-row" style="color:#087f5b;"><td style="vertical-align:top; white-space:nowrap;"><code>include_afolu</code></td><td>Whether AFOLU emissions are included inside the selected<br>&#10;<code>emission_type</code>. <strong>Defaults to</strong> <code>False</code>.</td></tr>n”, “<tr class="pyaesa-default-row" style="color:#087f5b;"><td style="vertical-align:top; white-space:nowrap;"><code>emissions_mode</code></td><td>Dynamic AR6 emissions mode. Accepted values are<br>&#10;<code>&quot;net&quot;</code>, <code>&quot;gross&quot;</code>, and <code>&quot;gross_alt&quot;</code>. <strong>Defaults to</strong><br>&#10;<code>&quot;gross_alt&quot;</code>. <code>&quot;net&quot;</code> uses net AR6 emissions pathways<br>&#10;directly. <code>&quot;gross&quot;</code> removes all sequestration sources from net<br>&#10;emissions. <code>&quot;gross_alt&quot;</code> removes all sequestration sources except<br>&#10;CCS. CCS is retained because IPCC AR6 treats CCS as capture at<br>&#10;fossil or industrial point sources rather than direct removal of<br>&#10;CO2 from the atmosphere, so it is kept separate from net negative<br>&#10;sequestration. Gross modes write positive emissions rows and<br>&#10;signed negative sequestration companion rows; downstream aCC and<br>&#10;ASR consume only the positive emissions rows. See<br>&#10;<code>data_raw/methodological_notes/methodological_note_steady_state_dynamic_cc.pdf</code><br>&#10;for the methodological explanation.</td></tr>n”, “<tr class="pyaesa-optional-row" style="color:#c45f00;"><td style="vertical-align:top; white-space:nowrap;"><code>subset_version</code></td><td>Optional selector for a subset of AR6 model-scenario<br>&#10;pairs. Follow<br>&#10;<code>data_processed/ar6/&lt;processed_scope&gt;/README_model_scenario_subset.txt</code><br>&#10;to create the subset CSV. <strong>Omit</strong> this argument to use every retained<br>&#10;model-scenario pair.<br>&#10;<strong>Defaults to</strong> <code>None</code>.</td></tr>n”, “<tr class="pyaesa-default-row" style="color:#087f5b;"><td style="vertical-align:top; white-space:nowrap;"><code>output_format</code></td><td>Persisted output file format: <code>&quot;csv&quot;</code> (<strong>default</strong>),<br>&#10;<code>&quot;pickle&quot;</code>, or <code>&quot;parquet&quot;</code>.</td></tr>n”, “<tr class="pyaesa-default-row" style="color:#087f5b;"><td style="vertical-align:top; white-space:nowrap;"><code>figures</code></td><td>Whether to render figures.<br>&#10;<strong>Default is</strong> <code>True</code>.</td></tr>n”, “<tr class="pyaesa-default-row" style="color:#087f5b;"><td style="vertical-align:top; white-space:nowrap;"><code>figure_format</code></td><td>Figure render settings mapping. <strong>Defaults to</strong><br>&#10;<code>{&quot;format&quot;: &quot;png&quot;, &quot;dpi&quot;: 500}</code>.<br>&#10;&#160;<br>&#10;Nested keys:<br>&#10;&#160;<br>&#10;&bull;&nbsp;<code>format</code>: Figure file format. Accepted values are <code>&quot;png&quot;</code>,<br>&#10; <code>&quot;pdf&quot;</code>, and <code>&quot;svg&quot;</code>.<br>&#10;&bull;&nbsp;<code>dpi</code>: Positive integer figure resolution used for raster<br>&#10; outputs.</td></tr>n”, “<tr class="pyaesa-default-row" style="color:#087f5b;"><td style="vertical-align:top; white-space:nowrap;"><code>refresh</code></td><td>If <code>True</code>, clear and recompute the resolved deterministic AR6 CC output scope for the requested study period, harmonization flag, harmonization method, emission variables, and subset version, plus the matching processed AR6 output scope selected by <code>process_ar6(…)</code> for that request. The cleared AR6 CC scope is the selector-specific <code>ar6_cc</code> deterministic output folder beside that processed AR6 scope. For example, for years 2019 to 2060, default harmonization, default Kyoto gas settings, category <code>[&quot;C1&quot;]</code>, and SSP <code>[&quot;SSP1&quot;]</code>, the refreshed path is <code>&lt;repo&gt;/data_processed/ar6/2019-2060_harmonization_offset/ar6_cc/gross_alt_kyoto_gases_wo_afolu/C1_SSP1/deterministic</code>. Raw downloads and downstream aCC or ASR outputs are not refreshed. <strong>Defaults to</strong> <code>False</code>.</td></tr>n”, “</tbody>n”, “</table>n”, “n”, “</details>n”

]

}, {

“cell_type”: “markdown”, “id”: “8b2bf439”, “metadata”: {}, “source”: [

“### Extract dynamic AR6 CC for default AR6 categories and SSPs, using defaults where omitted”

]

}, {

“cell_type”: “code”, “execution_count”: null, “id”: “112ec1b2”, “metadata”: {}, “outputs”: [], “source”: [

“from pyaesa import deterministic_ar6_ccn”, “n”, “deterministic_ar6_cc(n”, “ years=range(2020, 2051),n”, “)”

]

}, {

“cell_type”: “markdown”, “id”: “2bc41a33”, “metadata”: {}, “source”: [

“### GHG (Kyoto gases) or CO2 emissions”

]

}, {

“cell_type”: “code”, “execution_count”: null, “id”: “73a0ac14”, “metadata”: {}, “outputs”: [], “source”: [

“deterministic_ar6_cc(n”, “ years=range(2020, 2051),n”, “ category=["C1", "C2"],n”, “ ssp_scenario=["SSP2"],n”, “ emission_type="co2",n”, “)”

]

}, {

“cell_type”: “markdown”, “id”: “570a502e”, “metadata”: {}, “source”: [

“# What to do next”

]

}, {

“cell_type”: “markdown”, “id”: “a8c0bcc2”, “metadata”: {}, “source”: [

Beginnersn”, “n”, “If you are a new user in the process of discovering <span class="pyaesa-brand-py" style="color:#366e9c"><strong>py</strong></span><span class="pyaesa-brand-aesa" style="color:#c83737"><strong>aesa</strong></span>, it is recommend that you first discover all study objectives with the basic features available.n”, “Have a look at the other notebooks available at [tutorials/study_objectives/0_study_objectives.md](../0_study_objectives.md)n”, “n”, “Expertsn”, “n”, “If you are already familiar with <span class="pyaesa-brand-py" style="color:#366e9c"><strong>py</strong></span><span class="pyaesa-brand-aesa" style="color:#c83737"><strong>aesa</strong></span> and if you want to discover advanced features available, check out examples in the next section of this tutorial !”

]

}, {

“cell_type”: “markdown”, “id”: “07ae20ba”, “metadata”: {}, “source”: [

“# Advanced features”

]

}, {

“cell_type”: “markdown”, “id”: “3524122d”, “metadata”: {}, “source”: [

“Advanced features currently available include:n”, “- Subset of model-scenariosn”, “- Net, gross, and gross_alt emissionsn”, “- Including or excluding AFOLU emissionsn”, “- Changing the emissions harmonization method (not yet available!)”

]

}, {

“cell_type”: “markdown”, “id”: “b081775e”, “metadata”: {}, “source”: [

“### Subset of model-scenarios”

]

}, {

“cell_type”: “markdown”, “id”: “7f5213c3”, “metadata”: {}, “source”: [

subset_version selects a custom model-scenario pair subset prepared from data_processed/ar6/<processed_scope>/README_model_scenario_subset.txt.”

]

}, {

“cell_type”: “code”, “execution_count”: null, “id”: “f4eac24c”, “metadata”: {}, “outputs”: [], “source”: [

“deterministic_ar6_cc(n”, “ years=range(2020, 2051),n”, “ category=["C1", "C2"],n”, “ ssp_scenario=["SSP2"],n”, “ subset_version="selected_pairs",n”, “)”

]

}, {

“cell_type”: “markdown”, “id”: “130b344e”, “metadata”: {}, “source”: [

“### Net, gross, and gross_alt emissions”

]

}, {

“cell_type”: “markdown”, “id”: “c83cba01”, “metadata”: {}, “source”: [

emissions_mode selects the dynamic AR6 emissions basis used to buildn”, “dynamic carrying capacity values. The default is "gross_alt".n”, “n”, “- "net" uses net AR6 emissions pathways directly.n”, “- "gross" removes all sequestration sources from net emissions.n”, “- "gross_alt" removes sequestration sources except CCS. CCS is retained becausen”, “ IPCC AR6 treats CCS as capture at fossil or industrial point sources rathern”, “ than direct removal of CO2 from the atmosphere, so it is kept separate fromn”, “ net negative sequestration.n”, “n”, “Gross modes also write signed sequestration companion rows for interpretation.n”, “Downstream aCC and ASR runs consume the positive rows.”

]

}, {

“cell_type”: “code”, “execution_count”: null, “id”: “7122f8b3”, “metadata”: {}, “outputs”: [], “source”: [

“deterministic_ar6_cc(n”, “ years=range(2020, 2051),n”, “ category=["C1", "C2"],n”, “ ssp_scenario=["SSP2"],n”, “ emissions_mode="net",n”, “)n”, “n”, “deterministic_ar6_cc(n”, “ years=range(2020, 2051),n”, “ category=["C1", "C2"],n”, “ ssp_scenario=["SSP2"],n”, “ emissions_mode="gross",n”, “)”

]

}, {

“cell_type”: “markdown”, “id”: “8fccbc6a”, “metadata”: {}, “source”: [

“### Including or excluding AFOLU emissions”

]

}, {

“cell_type”: “markdown”, “id”: “8490caa1”, “metadata”: {}, “source”: [

include_afolu=False is the default and excludes Agriculture, Forestry andn”, “Other Land Use (AFOLU) emissions for the selected emission_type. Usen”, “include_afolu=True when the study objective requires Agriculture, Forestryn”, “and Other Land Use (AFOLU) emissions for the selected emission_type.”

]

}, {

“cell_type”: “code”, “execution_count”: null, “id”: “26c83c31”, “metadata”: {}, “outputs”: [], “source”: [

“deterministic_ar6_cc(n”, “ years=range(2020, 2051),n”, “ category=["C1", "C2"],n”, “ ssp_scenario=["SSP2"],n”, “ include_afolu=True,n”, “)”

]

}

], “metadata”: {

“kernelspec”: {

“display_name”: “env-pyaesa-test”, “language”: “python”, “name”: “python3”

}, “language_info”: {

“codemirror_mode”: {

“name”: “ipython”, “version”: 3

}, “file_extension”: “.py”, “mimetype”: “text/x-python”, “name”: “python”, “nbconvert_exporter”: “python”, “pygments_lexer”: “ipython3”, “version”: “3.13.13”

}

}, “nbformat”: 4, “nbformat_minor”: 5

}