Shared Socioeconomic Pathways (project.ssp
)
Structure
The enumerations SSP_2017
and SSP_2024
contain one member from the corresponding SDMX code lists.
These can be used to uniquely identify both an SSP narrative and the set in which it occurs, in applications where this distinction is meaningful:
>>> from message_ix_models.project.ssp import SSP_2017, SSP_2024
>>> x = SSP_2017["2"]
>>> y = SSP_2024["2"]
>>> str(y)
"ICONICS:SSP(2024).2"
>>> x == y
False
- message_ix_models.project.ssp.SSP
alias of
ICONICS:SSP(2017)
- message_ix_models.project.ssp.SSP_2017
alias of
ICONICS:SSP(2017)
- message_ix_models.project.ssp.SSP_2024
alias of
ICONICS:SSP(2024)
- message_ix_models.project.ssp.generate(context: Context, base_dir: PathLike | None = None)[source]
Generate SDMX code lists containing the SSPs.
Data
Although free of charge, neither the 2017 or 2024 SSP data can be downloaded automatically.
Both sources require that users first submit personal information to register before being able to retrieve the data.
message_ix_models
does not circumvent this requirement.
Thus:
A copy of the data are stored in
message_data
.message_ix_models
contains only a ‘fuzzed’ version of the data (same structure, random values) for testing purposes.
Todo
Allow users without access to message_data
to read a local copy of this data from a Config.local_data
subdirectory.
|
Provider of exogenous data from the original SSP database. |
|
Provider of exogenous data from the SSP Update database. |
- class message_ix_models.project.ssp.data.SSPOriginal(source, source_kw)[source]
Provider of exogenous data from the original SSP database.
To use data from this source, call
exo_data.prepare_computer()
with the arguments:source: Any value from
SSP_2017
or equivalent string, for instance “ICONICS:SSP(2017).2”. The specific SSP for which data is returned is determined from the value.source_kw including:
“model”: one of:
IIASA GDP
IIASA-WiC POP
NCAR
OECD Env-Growth
PIK GDP-32
“measure”: The measures available differ according to the model; see the source data for details.
Example
>>> keys = prepare_computer( ... context, ... computer, ... source="ICONICS:SSP(2015).3", ... source_kw=dict(measure="POP", model="IIASA-WiC POP"), ... ) >>> result = computer.get(keys[0])
- filename = 'SspDb_country_data_2013-06-12.csv.zip'
Name of file containing the data.
- model_date = {'IIASA GDP': '130219', 'IIASA-WiC POP': '130115', 'NCAR': '130115', 'OECD Env-Growth': '130325', 'PIK GDP-32': '130424'}
One-to-one correspondence between “model” codes and date fragments in scenario codes.
- replace = {'billion US$2005/yr': 'billion USD_2005/yr'}
Replacements to apply when loading the data.
- class message_ix_models.project.ssp.data.SSPUpdate(source, source_kw)[source]
Provider of exogenous data from the SSP Update database.
To use data from this source, call
exo_data.prepare_computer()
with the arguments:source: Any value from
SSP_2024
or equivalent string, for instance “ICONICS:SSP(2024).2”.release: One of “3.0.1”, “3.0”, or “preview”.
Example
>>> keys = prepare_computer( ... context, ... computer, ... source="ICONICS:SSP(2024).3", ... source_kw=dict(measure="GDP", model="IIASA GDP 2023"), ... ) >>> result = computer.get(keys[0])
- filename = {'3.0': '1706548837040-ssp_basic_drivers_release_3.0_full.csv.gz', '3.0.1': '1710759470883-ssp_basic_drivers_release_3.0.1_full.csv.gz', 'preview': 'SSP-Review-Phase-1.csv.gz'}
File names containing the data, according to the release.
2024 update
Transport
Postprocess aviation emissions for SSP 2024.
Use mix-models ssp transport --help in.xlsx out.xlsx to invoke main()
.
- message_ix_models.project.ssp.transport.EXPR = '^Emissions\\|(?P<e>[^\\|]+)\\|Energy\\|Demand\\|Transportation(?:\\|(?P<t>.*))?$'
Expression for IAMC ‘variable’ names used in
main()
.
- message_ix_models.project.ssp.transport.aviation_share(ref: AnyQuantity) → AnyQuantity[source]
Return (dummy) data for the share of aviation in emissions.
Currently this returns exactly the value 0.2.
- Parameters:
ref – Reference quantity. The dimensions and coordinates \((n, e, y)\) of the returned value exactly match ref.
- Returns:
with dimensions \((n, e, y)\).
- Return type:
- message_ix_models.project.ssp.transport.extract_dims(qty: AnyQuantity, dim_expr: dict, *, drop: bool = True, fillna: str = '_T') → AnyQuantity[source]
Extract dimensions from IAMC-like ‘variable’ names using regular expressions.
- message_ix_models.project.ssp.transport.extract_dims1(qty: AnyQuantity, dim: dict) → AnyQuantity[source]
Extract dimensions from IAMC-like ‘variable’ names expressions.
Note
This incomplete, non-working version of
extract_dims()
usesxarray
semantics.
- message_ix_models.project.ssp.transport.finalize(q_all: AnyQuantity, q_update: AnyQuantity, model_name: str, scenario_name: str, path_out: pathlib.Path) → None[source]
Finalize output.
Reattach “Model” and “Scenario” labels.
Reassemble the “Variable” dimension/coords of q_update; drop “e” and “t”.
Convert both q_all and q_update to
pandas.Series
; update the former with the contents of the latter.Adjust to IAMC ‘wide’ structure and write to path_out.
- Parameters:
q_all – All data.
q_update – Revised data to overwrite corresponding values in q_all.
- message_ix_models.project.ssp.transport.main(path_in: pathlib.Path, path_out: pathlib.Path)[source]
Postprocess aviation emissions for SSP 2024.
Read input data from path_in.
Select data with variable names matching
EXPR
.Calculate (identical) values for:
Emissions|*|Energy|Demand|Transportation|Aviation
Emissions|*|Energy|Demand|Transportation|Aviation|International
These are currently calculated as the product of
aviation_share()
andEmissions|*|Energy|Demand|Transportation
.Subtract (3) from:
Emissions|*|Energy|Demand|Transportation|Road Rail and Domestic Shipping
Recombine with all other, unmodified data.
Write to path_out.
- Parameters:
path_in – Input data path.
path_out – Output data path.