gcages.cmip7_scenariomip.gridding_emissions#
Handling of gridding emissions
Classes:
| Name | Description |
|---|---|
SpatialResolutionOption |
Spatial resolution option |
Functions:
| Name | Description |
|---|---|
get_complete_gridding_index |
Get the index of complete gridding data |
to_global_workflow_emissions |
Convert gridding emissions to global workflow emissions |
to_global_workflow_emissions_from_stacked |
Convert pre-stacked gridding emissions to global workflow emissions |
Attributes:
| Name | Type | Description |
|---|---|---|
CO2_BIOSPHERE_SECTORS_GRIDDING |
tuple[str, ...]
|
Sectors that come from biospheric CO2 reservoirs (gridding naming convention) |
CO2_FOSSIL_SECTORS_GRIDDING |
tuple[str, ...]
|
Sectors that come from or go to fossil CO2 reservoirs (gridding naming convention) |
COMPLETE_GRIDDING_SECTORS_CDR |
tuple[str, ...]
|
Complete set of sectors for gridding CDR sectors |
COMPLETE_GRIDDING_SECTORS_EXCEPT_CDR |
tuple[str, ...]
|
Complete set of sectors for gridding excluding CDR sectors |
COMPLETE_GRIDDING_SPECIES |
tuple[str, ...]
|
Complete set of species for gridding |
CO2_BIOSPHERE_SECTORS_GRIDDING
module-attribute
#
CO2_BIOSPHERE_SECTORS_GRIDDING: tuple[str, ...] = (
"Agriculture",
"Agricultural Waste Burning",
"Forest Burning",
"Grassland Burning",
"Peat Burning",
)
Sectors that come from biospheric CO2 reservoirs (gridding naming convention)
Not a perfect split with CO2_FOSSIL_SECTORS_GRIDDING, but the best we can do.
CO2_FOSSIL_SECTORS_GRIDDING
module-attribute
#
CO2_FOSSIL_SECTORS_GRIDDING: tuple[str, ...] = (
"Aircraft",
"BECCS",
"International Shipping",
"Energy Sector",
"Industrial Sector",
"Other CDR",
"Enhanced Weathering",
"Direct Air Capture",
"Ocean",
"Biochar",
"Soil Carbon Management",
"Residential Commercial Other",
"Solvents Production and Application",
"Transportation Sector",
"Waste",
)
Sectors that come from or go to fossil CO2 reservoirs (gridding naming convention)
BECCS is here because the carbon is stored permanently (or assumed to be). It is grown then removed from the land pool, so is 'net zero' from the land pool's point of view (and handling this really well requires running a carbon cycle model to determine the possible uptake from the BECCS land-use, which isn't how the split between modelling domains works at the moment).
There is the same issue for some non-land CDR e.g. ocean alkalinity stuff. Again, a handling sophisticiated enough to capture this properly is beyond the scope of the fossil/biosphere split we're making here.
Not a perfect split with CO2_BIOSPHERE_SECTORS_GRIDDING, but the best we can do.
COMPLETE_GRIDDING_SECTORS_CDR
module-attribute
#
COMPLETE_GRIDDING_SECTORS_CDR: tuple[str, ...] = (
"BECCS",
"Enhanced Weathering",
"Direct Air Capture",
"Ocean",
"Biochar",
"Soil Carbon Management",
)
Complete set of sectors for gridding CDR sectors
COMPLETE_GRIDDING_SECTORS_EXCEPT_CDR
module-attribute
#
COMPLETE_GRIDDING_SECTORS_EXCEPT_CDR: tuple[str, ...] = (
"Agricultural Waste Burning",
"Agriculture",
"Aircraft",
"Energy Sector",
"Forest Burning",
"Grassland Burning",
"Industrial Sector",
"International Shipping",
"Peat Burning",
"Residential Commercial Other",
"Solvents Production and Application",
"Transportation Sector",
"Waste",
"Other CDR",
)
Complete set of sectors for gridding excluding CDR sectors
COMPLETE_GRIDDING_SPECIES
module-attribute
#
COMPLETE_GRIDDING_SPECIES: tuple[str, ...] = (
"CO2",
"CH4",
"N2O",
"BC",
"CO",
"NH3",
"OC",
"NOx",
"Sulfur",
"VOC",
)
Complete set of species for gridding
SpatialResolutionOption #
Bases: StrEnum
Spatial resolution option
Attributes:
| Name | Type | Description |
|---|---|---|
MODEL_REGION |
Data reported at the (IAM) model region level |
|
WORLD |
Data reported at the world (i.e. global) level |
Source code in src/gcages/cmip7_scenariomip/gridding_emissions.py
get_complete_gridding_index #
get_complete_gridding_index(
model_regions: tuple[str, ...],
world_gridding_sectors: tuple[str, ...] = (
"Aircraft",
"International Shipping",
),
world_region: str = "World",
region_level: str = "region",
variable_level: str = "variable",
table: str = "Emissions",
level_separator: str = "|",
) -> MultiIndex
Get the index of complete gridding data
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_regions
|
tuple[str, ...]
|
Model regions to use while reaggregating |
required |
world_gridding_sectors
|
tuple[str, ...]
|
Sectors that should only be gridded at the world level |
('Aircraft', 'International Shipping')
|
world_region
|
str
|
The value used when the data represents the sum over all regions |
'World'
|
region_level
|
str
|
Region level in the data index |
'region'
|
variable_level
|
str
|
Variable level in the data index |
'variable'
|
table
|
str
|
Name of the 'table' for emissions Used to process and create variable names |
'Emissions'
|
level_separator
|
str
|
Separator between levels in the variable names |
'|'
|
Returns:
| Type | Description |
|---|---|
MultiIndex
|
Index of complete gridding data |
Source code in src/gcages/cmip7_scenariomip/gridding_emissions.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | |
to_global_workflow_emissions #
to_global_workflow_emissions(
gridding_emissions: DataFrame,
time_name: str = "year",
region_level: str = "region",
world_region: str = "World",
global_workflow_co2_fossil_sector: str = "Fossil",
global_workflow_co2_biosphere_sector: str = "Biosphere",
co2_fossil_sectors: tuple[
str, ...
] = CO2_FOSSIL_SECTORS_GRIDDING,
co2_biosphere_sectors: tuple[
str, ...
] = CO2_BIOSPHERE_SECTORS_GRIDDING,
sectors_level: str = "sectors",
species_level: str = "species",
co2_name: str = "CO2",
) -> DataFrame
Convert gridding emissions to global workflow emissions
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gridding_emissions
|
DataFrame
|
Gridding emissions |
required |
time_name
|
str
|
Name of the time axis in |
'year'
|
region_level
|
str
|
Region level in the data index |
'region'
|
world_region
|
str
|
The value used when the data represents the sum over all regions |
'World'
|
global_workflow_co2_fossil_sector
|
str
|
Name of the CO2 'sector' with fossil origins to use in the output |
'Fossil'
|
global_workflow_co2_biosphere_sector
|
str
|
Name of the CO2 'sector' with biospheric origins to use in the output |
'Biosphere'
|
co2_fossil_sectors
|
tuple[str, ...]
|
Sectors to assume have an origin in fossil CO2 reservoirs |
CO2_FOSSIL_SECTORS_GRIDDING
|
co2_biosphere_sectors
|
tuple[str, ...]
|
Sectors to assume have an origin in biospheric CO2 reservoirs |
CO2_BIOSPHERE_SECTORS_GRIDDING
|
sectors_level
|
str
|
Sectors level in the data index |
'sectors'
|
species_level
|
str
|
Species level in the data index |
'species'
|
co2_name
|
str
|
String that indicates emissions of CO2 in variable names |
'CO2'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
Global workflow emissions |
Source code in src/gcages/cmip7_scenariomip/gridding_emissions.py
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | |
to_global_workflow_emissions_from_stacked #
to_global_workflow_emissions_from_stacked(
region_sector_df: DataFrame,
sector_df: DataFrame,
time_name: str,
region_level: str,
global_workflow_co2_fossil_sector: str,
global_workflow_co2_biosphere_sector: str,
co2_fossil_sectors: tuple[str, ...],
co2_biosphere_sectors: tuple[str, ...],
sectors_level: str,
species_level: str,
co2_name: str,
) -> tuple[
Series[NP_FLOAT_OR_INT], Series[NP_FLOAT_OR_INT]
]
Convert pre-stacked gridding emissions to global workflow emissions
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
region_sector_df
|
DataFrame
|
Data with region and sector levels |
required |
sector_df
|
DataFrame
|
Data with sector levels only |
required |
time_name
|
str
|
Name of the time axis in |
required |
region_level
|
str
|
Region level in the data index |
required |
global_workflow_co2_fossil_sector
|
str
|
Name of the CO2 'sector' with fossil origins to use in the output |
required |
global_workflow_co2_biosphere_sector
|
str
|
Name of the CO2 'sector' with biospheric origins to use in the output |
required |
co2_fossil_sectors
|
tuple[str, ...]
|
Sectors to assume have an origin in fossil CO2 reservoirs |
required |
co2_biosphere_sectors
|
tuple[str, ...]
|
Sectors to assume have an origin in biospheric CO2 reservoirs |
required |
sectors_level
|
str
|
Sectors level in the data index |
required |
species_level
|
str
|
Species level in the data index |
required |
co2_name
|
str
|
String that indicates emissions of CO2 in variable names |
required |
Returns:
| Type | Description |
|---|---|
sectors
|
Global workflow emissions with a sector level |
totals
|
Global workflow emissions only with totals (no region or sector level) |
Source code in src/gcages/cmip7_scenariomip/gridding_emissions.py
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 | |