General concept
This tutorial demonstrates basic concepts of the package.
import bonsai_ipcc
my_ipcc = bonsai_ipcc.IPCC()
Structure
The structure of the package is as followed:
ipcc.
<volume>
.<chapter>
.sequence.<tier_name>
ipcc.
<volume>
.<chapter>
.parameter.<parameter_name>
ipcc.
<volume>
.<chapter>
.dimension.<dimension_name>
ipcc.
<volume>
.<chapter>
.concordance.<concordance_name>
ipcc.
<volume>
.<chapter>
.elementary.<equation_name>
Get information about a tier sequence
help(my_ipcc.waste.incineration.sequence.tier1_co2)
Help on function tier1_co2 in module bonsai_ipcc.waste.incineration.sequence:
tier1_co2(year=2010, region='BG', product='msw_food', activity='open_burn', uncertainty='def')
Tier 1 method CO2 Emissions.
Default data to quantify waste generation, composition and management practice
(requirement: incineration or open burning is not a key category)
Argument
---------
year : int
year under study
region : str
region under study
product : str
Fraction of solid waste.
activity : str
Type of waste incineration.
uncertainty : str
'analytical', 'monte_carlo' or a property dimension, e.g. 'def'
Returns
-------
VALUE: DataClass
Inlcudes the results of each step of the sequence.
Inspect the involved parameters
my_ipcc.inspect(my_ipcc.waste.incineration.sequence.tier1_co2)
['b_frac',
'p_frac',
'gdp',
'urb_population',
'incintype_frac',
'msw_frac_to_incin',
'isw_gen_rate',
'msw_type_frac',
'dm',
'msw_gen_rate',
'fcf',
'isw_type_frac',
'of',
'cf',
'isw_frac_to_incin',
'total_population']
Show the table of a parameter
my_ipcc.waste.incineration.parameter.dm.head()
value | unit | ||||
---|---|---|---|---|---|
year | region | waste_type | property | ||
2006 | World | msw_food | def | 0.40 | kg/kg |
msw_garden | def | 0.40 | kg/kg | ||
msw_paper | def | 0.90 | kg/kg | ||
msw_wood | def | 0.84 | kg/kg | ||
msw_textiles | def | 0.80 | kg/kg |
help(my_ipcc.waste.incineration.elementary.msw_to_incin)
Help on function msw_to_incin in module bonsai_ipcc.waste.waste_generation.elementary:
msw_to_incin(urb_population, msw_gen_rate, msw_frac_to_incin, msw_type_frac)
Equation 2.y (not explicit in guidelines, tier 1)
Calculates the amount of municipal solid waste (MSW) disposed to incineration sites,
by using default data from chapter 2 (Waste Generation, Composition amd Management).
Argument
--------
urb_population (cap/year) : float
Urban population of a region in a given year.
msw_gen_rate (t/cap) : float
rate of municipal solid waste per capita.
msw_frac_to_incin (kg/kg) : float
Fraction of waste disposed to incineration in municipal solid waste.
Returns
-------
VALUE: float
amount of certain MSW type which is incinerated (tonnes/year)
Check dimension tables of the parameter msw_frac_to_swds
my_ipcc.waste.incineration.dimension.region
description | region_type | |
---|---|---|
code | ||
AF | Afghanistan | country |
AX | Åland Islands | country |
AL | Albania | country |
DZ | Algeria | country |
AS | American Samoa | country |
... | ... | ... |
ANT | Antarctica | continent |
AFR | Africa | continent |
EUR | Europe | continent |
ASI | Asia | continent |
AUS | Australia and New Zealand | continent |
285 rows × 2 columns
my_ipcc.waste.incineration.dimension.year.head()
description | |
---|---|
code | |
0 | place holder for emtpy tables |
1900 | year in which activity occurs |
1901 | year in which activity occurs |
1902 | year in which activity occurs |
1903 | year in which activity occurs |
my_ipcc.waste.incineration.dimension.property
description | remarks | |
---|---|---|
code | ||
def | default | mean |
min | minimum | 2.5th percentile |
max | maximum | 97.5th percentile |
abs_max | absolute maximun | theoretical upper bound |
abs_min | absolute minimum | theoretical lower bound |
dummy | place holder for emtpy tables | NaN |
Concordance tables
Concordance tables are used to automated reading parameter
values within a tier sequence.
When reading the parameter
value for a certain dimension
, in general, this value is specified in the parameter
table.
However, the requirement to define all parameter
values for each dimension
explicitally in the parameter
table would lead to a lot of repetition. To avoid this, the concept of concordance
tables is used. Each attribute of a dimension
can be hierarchically mapped to others. When using the concordance
table for a dimension
, the algorithm checks automatically if values for other dimension
attributes are available in the parameter
table
Let´s have a look to the concordance
table for the dimension
‘region’.
my_ipcc.waste.incineration.concordance.region.head()
unregion | geographicregion | continent | world | |
---|---|---|---|---|
country | ||||
AF | Southern Asia | NaN | ASI | World |
AX | Northern Europe | NaN | EUR | World |
AL | Southern Europe | NaN | EUR | World |
DZ | Northern Africa | NaN | AFR | World |
AS | Polynesia | NaN | AUS | World |
When reading a parameter
within a sequence for the region
Albania (‘AL’), the algorithm would start trying to find the value for ‘AL’. If there is no value for ‘AL’ in the parameter
table, it would try to find the value for ‘Southern Europe’, stepwise until to the last item of the column. In this case this is ‘World’, which indicates the validity of the parameter
value for all regions.
(‘NaN’ is skipped during the approach)
my_ipcc.waste.incineration.concordance.year.head()
cat3 | cat2 | cat1 | cat0 | |
---|---|---|---|---|
cat4 | ||||
2006 | 2019 | NaN | NaN | NaN |
2007 | 2006 | 2019.0 | NaN | NaN |
2008 | 2006 | 2019.0 | NaN | NaN |
2009 | 2006 | 2019.0 | NaN | NaN |
2010 | 2006 | 2019.0 | NaN | NaN |
Look at the additional tutorials how to run a tier sequence.