Reference
This page contains in-depth documentation of ghgpy
package. Use it as a
reference for the technical implementation of the
ghgpy
by iClimate project code.
GHG inventory for Energy sector Base on the IPCC 2006 w 2019 refinement (c) Bui Khac Tu (bkt92)
Combustion
Bases: ADCombussion
Stationary combustion (SC)
name
: Activity name
desc
: More description
fuels_list
: Fuel list
efs_list
: List of emission factor corresponding to fuels
results
: Emission evaluation result
Source code in src\ghgpy\activities\energy.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 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 |
|
add(name, amount, unit, fuel_db=None, efdb=None, force=False)
Add a fuel to fuels list
- Required database for emission factors
- Required fuel class (datamodel)
- force
= True: Overwrite existing fuel data
Source code in src\ghgpy\activities\energy.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
add_custom(fuel_data, ef_data, force=False)
Add a custom fuel to fuels list with custom data fuel_data = { 'name': 'Diesel_Oil', 'amount': {'value': 1000.0, 'uncertainty': 0}, 'unit': 'l', 'properties': { 'desc': 'Gas/Diesel Oil', 'ncv': {'value': 43.0, 'uncertainty': 0.0}, 'ccf': {'value': 20.2, 'uncertainty': 0.4}, 'density': {'value': 844.0, 'uncertainty': 0.0}}}
ef_data = { "co2": {"value": 54600, "uncertainty": 0 }, "ch4": {"value": 1, "uncertainty": 0 }, "n2o": {"value": 0.1, "uncertainty": 0}
Source code in src\ghgpy\activities\energy.py
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 |
|
emission(unit='t')
Total emission in unit of CO2e (Default in metric tonnes
)
Source code in src\ghgpy\activities\energy.py
64 65 66 67 68 69 |
|
eval()
Evaluate the activity for ghg emission - Current GHG: CO2, CH4 and N2O - Required GHG database - Return a list of GHG emission from this activity
Source code in src\ghgpy\activities\energy.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|
list_fuels()
List all fuels in the combustion class
Source code in src\ghgpy\activities\energy.py
149 150 151 152 153 |
|
load_data(data)
classmethod
Load data to the class
Source code in src\ghgpy\activities\energy.py
155 156 157 158 159 160 |
|
remove(name)
Remove a fuel from the list
Use list_fuels() method to check the list
Source code in src\ghgpy\activities\energy.py
137 138 139 140 141 142 143 144 145 146 147 |
|
iClimate - ghgpy
Fuel objects Represent a amount of a specific fuel (C) Bui Khac Tu (bkt92) (C) iClimate
BaseFuel
Bases: FuelData
Base Fuel Object (use for all kind of fuel)
Representative by TJ
Allow "+, -" operators with the same kind of fuel
Allow convert to different property (Weight, Volume, Carbon Content)
Source code in src\ghgpy\datamodel\fuel.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 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 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
|
cal_energy(unit='tj')
Energy of Fuel in unit
Default unit Tj
Source code in src\ghgpy\datamodel\fuel.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
cal_volume(unit='l')
Volume of Fuel in unit
Default unit litre
Source code in src\ghgpy\datamodel\fuel.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
cal_weight(unit='kg')
Weight of Fuel in unit
Unit default kg
Source code in src\ghgpy\datamodel\fuel.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
|
calc_cc(unit='kg')
Carbon content of Fuel in unit
Default unit kg
Source code in src\ghgpy\datamodel\fuel.py
87 88 89 90 91 92 93 94 95 96 |
|
from_dict(data)
classmethod
Load json file to fuel class schema: { name: Name/code of fuel, amount: Amount of fuel (unit), unit: Unit of amount fuel, properties: { desc: More information about fuel ncv: Net calorific value (Tj/Gg) ccf: Carbon content of fuel (kg/GJ) density: Density of fuel (kg/m3) } }
Source code in src\ghgpy\datamodel\fuel.py
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
|
DefaultFuel
Bases: BaseFuel
amount: amount of fuel
unit: unit of fuel
Data Sources:
Calorific value: 2006 IPCC Guidelines for National Greenhouse Gas Inventories V2_Ch1 - TABLE 1.2: https://www.ipcc-nggip.iges.or.jp/public/2006gl/pdf/2_Volume2/V2_1_Ch1_Introduction.pdf
Density: IEA Database documentation: https://wds.iea.org/wds/pdf/oil_documentation.pdf
Source code in src\ghgpy\datamodel\fuel.py
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
|
from_json(database, data)
classmethod
Load json file to fuel class Schema: { name: Name/code of fuel, amount: amount of fuel (unit), unit: unit of amount fuel }
Source code in src\ghgpy\datamodel\fuel.py
216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
|
dict_to_fuel(data, database)
Schema: Class FuelData
Load json file to fuel class schema: { name: Name/code of fuel, amount: Amount of fuel (unit), unit: Unit of amount fuel, properties: { desc: More information about fuel ncv: Net calorific value (Tj/Gg) ccf: Carbon content of fuel (kg/GJ) density: Density of fuel (kg/m3) } }
Source code in src\ghgpy\datamodel\fuel.py
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 |
|
iClimate - ghgpy
GHG Gas objects Represent a amount of a specific ghg gas (C) Bui Khac Tu (bkt92) (C) iClimate
GHGGas
Bases: GHGDATA
GHG Gas Object (use for all kind of GHG gas)
Representative by tCO2e
Allow "+, -" operators with the same kind of gas
Source code in src\ghgpy\datamodel\ghg.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
cal_weight(unit='tonne')
Convert to metric unit /n Default unit metric tonnes
Source code in src\ghgpy\datamodel\ghg.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
from_dict(data)
classmethod
{'name': {'title': 'Name', 'type': 'string'}, 'amount': {'title': 'Amount', 'type': 'number'}, 'unit': {'title': 'Unit', 'type': 'string'}, 'desc': {'title': 'Desc', 'type': 'string'}, 'gwp': {'title': 'Gwp', 'type': 'number'}, 'density': {'title': 'Density', 'type': 'number'}}
Source code in src\ghgpy\datamodel\ghg.py
83 84 85 86 87 88 89 90 91 92 93 |
|
Unit Converters for GHG inventory (c) Bui Khac Tu (bkt92)
energy_units
Convert between difference energy units
Source code in src\ghgpy\datamodel\unit_converters.py
6 7 8 9 10 11 12 13 14 15 |
|
volume_units
Convert between difference volume units
Source code in src\ghgpy\datamodel\unit_converters.py
27 28 29 30 31 32 33 34 35 |
|
weigh_units
Convert between difference weigh units
Source code in src\ghgpy\datamodel\unit_converters.py
17 18 19 20 21 22 23 24 25 |
|